One USB Drive, Two Partitions. Much useful.

In a follow up to the Dogecoin client install post, here is steps to create multiple partitons on a single USB drive so one can both boot and store files on the same USB drive.

Partition the USB drive. I made two partitions. One 2GB FAT32, and 28.5GB ext4. I initially did this for Arch Linux, but added/changed to Ubuntu for dogecoin users. A few of the steps below when partitioning are not actually needed when you use unetbootin to write the iso, however there is no harm in doing them.

[jmorgan@arch-dopey ~]$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.24).  
Changes will remain in memory only, until you decide to write them.  
Be careful before using the write command.

#Current (Empty)  
Command (m for help): p  
Disk /dev/sdc: 30.5 GiB, 32717537280 bytes, 63901440 sectors  
Units: sectors of 1 * 512 = 512 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disklabel type: dos  
Disk identifier: 0xc3072e18

#Create 2GB Partition  
Command (m for help): n

Partition type:  
p primary (0 primary, 0 extended, 4 free)  
e extended  
Select (default p): p  
Partition number (1-4, default 1):  
First sector (2048-63901439, default 2048):  
Last sector, +sectors or +size{K,M,G,T,P} (2048-63901439, default
63901439): +2GB

Created a new partition 1 of type 'Linux' and of size 1.9 GiB.  
#Change type  
Command (m for help): t  
Selected partition 1  
Hex code (type L to list all codes): L

0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris  
1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-  
2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-  
3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-  
4 FAT16 \<32M 40 Venix 80286 85 Linux extended c7 Syrinx  
5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data  
6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .  
7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility  
8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt  
9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access  
a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O  
b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor  
c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs  
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT  
f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/  
10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b  
11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor  
12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor  
14 Hidden FAT16 \<3 61 SpeedStor ab Darwin boot f2 DOS secondary  
16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS  
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE  
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto  
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep  
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT  
1e Hidden W95 FAT1 80 Old Minix  
#b is FAT32  
Hex code (type L to list all codes): b  
If you have created or modified any DOS 6.x partitions, please see the
fdisk documentation for additional information.  
Changed type of partition 'Linux' to 'W95 FAT32'.

#Change bootable flag  
Command (m for help): a  
Selected partition 1  
#Create 28.5GB partition  
Command (m for help): n

Partition type:  
p primary (1 primary, 0 extended, 3 free)  
e extended  
Select (default p):

Using default response p.  
Partition number (2-4, default 2):  
First sector (3907584-63901439, default 3907584):  
Last sector, +sectors or +size{K,M,G,T,P} (3907584-63901439, default
63901439):

Created a new partition 2 of type 'Linux' and of size 28.6 GiB.  
#Write partition table  
Command (m for help): w  
The partition table has been altered.  
Calling ioctl() to re-read partition table.  
Syncing disks.

[jmorgan@arch-dopey ~]$

Create the filesystems, FAT32 and ext4 for me.

#FAT32 -- For Arch bootable iso, this label must match the release
version used -- Not important for Ubuntu/unetbootin  
[jmorgan@arch-dopey ~]$ sudo mkdosfs -F 32 -n ARCH_201401 /dev/sdc1  
mkfs.fat 3.0.24 (2013-11-23)  
#ext4  
[jmorgan@arch-dopey ~]$ sudo mkfs.ext4 /dev/sdc2  
mke2fs 1.42.8 (20-Jun-2013)  
Filesystem label=  
OS type: Linux  
Block size=4096 (log=2)  
Fragment size=4096 (log=2)  
Stride=0 blocks, Stripe width=0 blocks  
1875968 inodes, 7499232 blocks  
374961 blocks (5.00%) reserved for the super user  
First data block=0  
Maximum filesystem blocks=4294967296  
229 block groups  
32768 blocks per group, 32768 fragments per group  
8192 inodes per group  
Superblock backups stored on blocks:  
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208,  
4096000

Allocating group tables: done  
Writing inode tables: done  
Creating journal (32768 blocks): done  
Writing superblocks and filesystem accounting information: done

[jmorgan@arch-dopey ~]$

At this point you have a single USB drive with two partitions. One with the intent of being used for bootable image(Ubuntu, Arch, etc) and the other for storing data.

If you are reading this post for Dogecoin I suggest using unetbootin along with Ubuntu 12.04 iso. Select the Ubuntu iso, and specify the smaller(first) partition to write to. You can store the needed files for the client install on the other partition. Here is how.

You can let unetbootin download the iso for you, or in my case use a local iso. I've already downloaded Ubuntu 64-bit 12.04. I've selected this iso, and the first partition on the USB drive(sdc1).

unetbootin

Checking what we've done, and storing needed files onto the second partition.

#mount the partiton unetbootin wrote Ubuntu 12.04 to:  
[jmorgan@arch-dopey ~]$ sudo mount /dev/sdc1 /mnt/os  
#mount the partition used for storage.  
[jmorgan@arch-dopey ~]$ sudo mount /dev/sdc2 /mnt/files  
#contents of what unetbootin created  
[jmorgan@arch-dopey ~]$ ls /mnt/os/  
arch dists ldlinux.c32 menu.c32 README.diskdefines ubninit  
autorun.inf EFI ldlinux.sys pics syslinux ubnkern  
boot install loader pool syslinux.cfg ubnpathl.txt  
casper isolinux md5sum.txt preseed ubnfilel.txt wubi.exe  
[jmorgan@arch-dopey ~]$

#copying dogecoin-qt tar with deps, and script to build dogecoin-qt
after booting Ubuntu 12.04.  
[jmorgan@arch-dopey ~]$ sudo cp
dogecoin-qt-1.5-ubuntu-12.04-Live-Install.tar /mnt/files/  
[jmorgan@arch-dopey ~]$ ls
/mnt/files/dogecoin-qt-1.5-ubuntu-12.04-Live-Install.tar  
/mnt/files/dogecoin-qt-1.5-ubuntu-12.04-Live-Install.tar  
[jmorgan@arch-dopey ~]$

At this point you can follow the previous post, Dogecoin Ubuntu Live CD Installer. I personally carry a USB bottle opener my sister gave me which has a bootable linux distro on one partition, and storage on the other. At any time I can open a beer, and boot linux!In that order ofcourse. :)

Doge: D8kWKgF2x6gsiZzRyXgonogPQuRMxf6qtp

more ...

NS2 Dedicated Server - Linux

Natural Selection 2 released both client and server version for Linux this week. Up till now you've had to use wine to host NS2 on Linux, now you can use Linux. This assumes you are already familiar with steamcmd, and have it working. Using Fedora below.

You have to use appId ~~4920 instead o~~f 4940. -- 4940 appId is now working.

#Had an issue with finding 32 bit libspeex libraries. I ended up
installing the below two rpms which resolved the dep issue. I also had
to install gtk2.  
[jpyth@jpyth ns2]$ ls *rpm  
libspeex1-32bit-1.1.999_1.2rc1-9.1.x86_64.rpm  
libspeexdsp1-32bit-1.1.999_1.2rc1-35.7.x86_64.rpm  
[jpyth@jpyth ns2]$

[jpyth@jpyth steamcmd]$ ./steamcmd.sh +login LOGIN PASSWORD
+force_install_dir PATH +app_update 4940 validate  
#example -- Installs Natural Selection 2, into a directory 'ns2' one
directory up from my current path.  
[jpyth@jpyth steamcmd]$ ./steamcmd.sh +login myrealemail@hotmail.com
noway01 +force_install_dir ../ns2/ +app_update 4940 validate  
#Start the game:  
[jpyth@jpyth steamcmd]$ cd ../ns2  
#start server  
[jpyth@jpyth ns2]$ ./server_linux32 -ip 198.27.65.132 -port 27035
-map ns2_tram -name "jpyth.com|NS2|#1" -limit 24 -console
-config_path ./config

#I launch mine with screen, using this script:  
[jpyth@jpyth bin]$ cat ns2  
#!/bin/sh  
name="$1"  
port=$2  
cd /home/jpyth/ns2  
screen -d -m -S ns2 ./server_linux32 -ip 198.27.65.132 -port $port
-map ns2_tram -name "$name" -limit 24 -console -config_path ./config  
#example  
[jpyth@jpyth bin]$ ns2 "jpyth.com|NS2|#1" 27030  
[jpyth@jpyth bin]$

Currently hosting two NS2 servers. Can find them below:
One
Two

more ...

Spell Check

Simple, but I'm sure many people go around running Arch(and other distros) without spell check when using firefox/webmail/etc. Simple to fix, if you know.

I use hunspell, so I installed the English dictionary to go along with it.

[jmorgan@arch-jm ~]$ sudo pacman -S hunspell-en  
resolving dependencies...  
looking for inter-conflicts...

Packages (1): hunspell-en-7.1-2

Total Download Size: 0.36 MiB  
Total Installed Size: 1.65 MiB

:: Proceed with installation? [Y/n] y  
:: Retrieving packages ...  
hunspell-en-7.1-2-any 364.8 KiB 443K/s 00:01
[######################] 100%  
(1/1) checking keys in keyring
[######################] 100%  
(1/1) checking package integrity
[######################] 100%  
(1/1) loading package files
[######################] 100%  
(1/1) checking for file conflicts
[######################] 100%  
(1/1) checking available disk space
[######################] 100%  
(1/1) installing hunspell-en
[######################] 100%  
Optional dependencies for hunspell-en  
hunspell: the spell checking libraries and apps [installed]  
[jmorgan@arch-jm ~]$
more ...

Logitech g13 on Linux (Arch)

I've gamed on Linux for a few years, and about a year ago I picked up a Logitech G13. I've used the g13-git package from AUR without issue.

I remember information about g13 on Linux being a bit sparse/out-of-date when I first did it on my desktop, now that I'm doing it on my laptop I thought i'd share the steps/issues I encounter.

If you aren't running Arch, here is a link to the github g13 on Linux github project. The rest of this doc will assume you are running Arch Linux, but should help any Linux user.

Obtaining g13-git from AUR, building, and installing:

#get the .tar.gz from AUR && extract && cd $tar  
[jpyth@arch-jpyth aur]$ wget
https://aur.archlinux.org/packages/g1/g13-git/g13-git.tar.gz  
--2013-04-01 05:06:04--
https://aur.archlinux.org/packages/g1/g13-git/g13-git.tar.gz  
Resolving aur.archlinux.org (aur.archlinux.org)... 78.46.78.247,
2a01:4f8:120:34c2::2  
Connecting to aur.archlinux.org
(aur.archlinux.org)|78.46.78.247|:443... connected.  
HTTP request sent, awaiting response... 200 OK  
Length: 694 [application/x-gzip]  
Saving to: ‘g13-git.tar.gz’

100%[=========================================================================================================================================================================>]
694 --.-K/s in 0s

2013-04-01 05:06:05 (99.8 MB/s) - ‘g13-git.tar.gz’ saved [694/694]

[jpyth@arch-jpyth aur]$ tar -xvf g13-git.tar.gz  
g13-git/  
g13-git/PKGBUILD  
[jpyth@arch-jpyth aur]$ cd g13-git  
#makepkg  
[jpyth@arch-jpyth g13-git]$ makepkg  
==> Determining latest git revision...  
-> Version found: 20130401  
==> Making package: g13-git 20130401-1 (Mon Apr 1 05:06:13 PDT 2013)  
==> Checking runtime dependencies...  
==> Checking buildtime dependencies...  
==> Retrieving Sources...  
==> Extracting Sources...  
==> Starting build()...  
==> Connecting to GIT server....  
Cloning into 'g13'...  
remote: Counting objects: 61, done.  
remote: Compressing objects: 100% (58/58), done.  
remote: Total 61 (delta 26), reused 28 (delta 2)  
Unpacking objects: 100% (61/61), done.  
==> GIT checkout done or server timeout  
==> Starting make...  
Cloning into '/home/jpyth/aur/g13-git/src/g13-build'...  
done.  
g++ -o g13 -std=c++0x g13.cc -lusb-1.0  
g13.cc:4:34: fatal error: boost/lexical_cast.hpp: No such file or
directory  
compilation terminated.  
#This looks bad  
make: *** [g13] Error 1  
==> ERROR: A failure occurred in build().  
Aborting...  
[jpyth@arch-jpyth g13-git]$  
#Install boost to fix error -- The AUR package needs to be updated for
the dependency.  
[jpyth@arch-jpyth ~]$ pacman -S boost boost-libs  
#Much better /cheer  
[jpyth@arch-jpyth g13-git]$ makepkg  
==> Determining latest git revision...  
-> Version found: 20130401  
==> Making package: g13-git 20130401-1 (Mon Apr 1 05:11:45 PDT 2013)  
==> Checking runtime dependencies...  
==> Checking buildtime dependencies...  
==> Retrieving Sources...  
==> Extracting Sources...  
==> Starting build()...  
==> Connecting to GIT server....  
Cloning into 'g13'...  
remote: Counting objects: 61, done.  
remote: Compressing objects: 100% (58/58), done.  
remote: Total 61 (delta 26), reused 28 (delta 2)  
Unpacking objects: 100% (61/61), done.  
==> GIT checkout done or server timeout  
==> Starting make...  
Cloning into '/home/jpyth/aur/g13-git/src/g13-build'...  
done.  
g++ -o g13 -std=c++0x g13.cc -lusb-1.0  
g++ -o pbm2lpbm pbm2lpbm.c  
==> Entering fakeroot environment...  
==> Starting package()...  
==> Tidying install...  
-> Purging unwanted files...  
-> Compressing man and info pages...  
-> Stripping unneeded symbols from binaries and libraries...  
==> Creating package...  
-> Generating .PKGINFO file...  
-> Compressing package...  
==> Leaving fakeroot environment.  
==> Finished making: g13-git 20130401-1 (Mon Apr 1 05:11:51 PDT 2013)  
#Install your shiny new package:D  
[jpyth@arch-jpyth g13-git]$ sudo pacman -U
g13-git-20130401-1-x86_64.pkg.tar.xz

The configuration is detailed on the github project page here.In short to get working, you need a file with mappings from G13 to 'known' keys that you dump into a pipe(/tmp/g13-0) one way or another, the daemon will read from when started. When you start the daemon the available g13 keys and available system keys to map to are printed to stdout. An easy way to do this is a file with the binds that you simply cat into the pipe.

#start g13 daemon without a g13 connected - notice the known G13 keys,
and available keys to map.  
[jpyth@arch-jpyth jmorgan]# /usr/bin/g13  
Known keys on G13:  
BD DOWN G1 G10 G11 G12 G13 G14 G15 G16 G17 G18 G19 G2 G20 G21 G22 G3 G4
G5 G6 G7 G8 G9 L1 L2 L3 L4 LEFT LIGHT LIGHT_STATE M1 M2 M3 MR TOP
STICK_LEFT STICK_RIGHT STICK_UP STICK_DOWN  
Known keys to map to:  
KEY_0 KEY_1 KEY_2 KEY_3 KEY_4 KEY_5 KEY_6 KEY_7 KEY_8 KEY_9
KEY_A KEY_APOSTROPHE KEY_B KEY_BACKSLASH KEY_BACKSPACE KEY_C
KEY_CAPSLOCK KEY_COMMA KEY_D KEY_DELETE KEY_DOT KEY_DOWN KEY_E
KEY_END KEY_ENTER KEY_EQUAL KEY_ESC KEY_F KEY_F1 KEY_F10 KEY_F2
KEY_F3 KEY_F4 KEY_F5 KEY_F6 KEY_F7 KEY_F8 KEY_F9 KEY_G
KEY_GRAVE KEY_H KEY_HOME KEY_I KEY_INSERT KEY_J KEY_K KEY_KP0
KEY_KP1 KEY_KP2 KEY_KP3 KEY_KP4 KEY_KP5 KEY_KP6 KEY_KP7 KEY_KP8
KEY_KP9 KEY_KPASTERISK KEY_KPDOT KEY_KPMINUS KEY_KPPLUS KEY_L
KEY_LEFT KEY_LEFTALT KEY_LEFTBRACE KEY_LEFTCTRL KEY_LEFTSHIFT
KEY_M KEY_MINUS KEY_N KEY_NUMLOCK KEY_O KEY_P KEY_PAGEDOWN
KEY_PAGEUP KEY_Q KEY_R KEY_RIGHT KEY_RIGHTALT KEY_RIGHTBRACE
KEY_RIGHTCTRL KEY_RIGHTSHIFT KEY_S KEY_SCROLLLOCK KEY_SEMICOLON
KEY_SLASH KEY_SPACE KEY_T KEY_TAB KEY_U KEY_UP KEY_V KEY_W
KEY_X KEY_Y KEY_Z  
Found 0 G13s

I use one mapping for all games, but you could have different binds per game. Here is mine:
:::bash

bind $g13Key $mappedKey

[jpyth@arch-jpyth ~]$ cat wowBinds
bind G1 KEY_7
bind G2 KEY_8
bind G3 KEY_9
bind G4 KEY_0
bind G5 KEY_KPMINUS
bind G6 KEY_Q
bind G7 KEY_E
bind G8 KEY_TAB
bind G9 KEY_1
bind G10 KEY_2
bind G11 KEY_3
bind G12 KEY_4
bind G13 KEY_5
bind G14 KEY_6
bind G15 KEY_LEFTSHIFT
bind G16 KEY_R
bind G17 KEY_T
bind G18 KEY_Y
bind G19 KEY_F
bind G20 KEY_LEFTALT
bind G21 KEY_C
bind G22 KEY_V
bind L4 KEY_B
bind L3 KEY_M
bind MR KEY_F6
bind M3 KEY_F5
bind M2 KEY_F4
bind M1 KEY_F3
bind LEFT KEY_RIGHTBRACE
bind DOWN KEY_SPACE
bind STICK_LEFT KEY_A
bind STICK_RIGHT KEY_D
bind STICK_UP KEY_W
bind STICK_DOWN KEY_S
[jpyth@arch-jpyth ~]$

Confirming it works with a g13 attached

#cat bind file into g13-0 pipe, which will be loaded when the g13
daemon start.  
[jpyth@arch-jpyth jmorgan]# cat wowBinds > /tmp/g13-0  
#start with g13 connected  
[jpyth@arch-jpythg jpyth]# /usr/bin/g13  
Known keys on G13:  
BD DOWN G1 G10 G11 G12 G13 G14 G15 G16 G17 G18 G19 G2 G20 G21 G22 G3 G4
G5 G6 G7 G8 G9 L1 L2 L3 L4 LEFT LIGHT LIGHT_STATE M1 M2 M3 MR TOP
STICK_LEFT STICK_RIGHT STICK_UP STICK_DOWN  
Known keys to map to:  
KEY_0 KEY_1 KEY_2 KEY_3 KEY_4 KEY_5 KEY_6 KEY_7 KEY_8 KEY_9
KEY_A KEY_APOSTROPHE KEY_B KEY_BACKSLASH KEY_BACKSPACE KEY_C
KEY_CAPSLOCK KEY_COMMA KEY_D KEY_DELETE KEY_DOT KEY_DOWN KEY_E
KEY_END KEY_ENTER KEY_EQUAL KEY_ESC KEY_F KEY_F1 KEY_F10 KEY_F2
KEY_F3 KEY_F4 KEY_F5 KEY_F6 KEY_F7 KEY_F8 KEY_F9 KEY_G
KEY_GRAVE KEY_H KEY_HOME KEY_I KEY_INSERT KEY_J KEY_K KEY_KP0
KEY_KP1 KEY_KP2 KEY_KP3 KEY_KP4 KEY_KP5 KEY_KP6 KEY_KP7 KEY_KP8
KEY_KP9 KEY_KPASTERISK KEY_KPDOT KEY_KPMINUS KEY_KPPLUS KEY_L
KEY_LEFT KEY_LEFTALT KEY_LEFTBRACE KEY_LEFTCTRL KEY_LEFTSHIFT
KEY_M KEY_MINUS KEY_N KEY_NUMLOCK KEY_O KEY_P KEY_PAGEDOWN
KEY_PAGEUP KEY_Q KEY_R KEY_RIGHT KEY_RIGHTALT KEY_RIGHTBRACE
KEY_RIGHTCTRL KEY_RIGHTSHIFT KEY_S KEY_SCROLLLOCK KEY_SEMICOLON
KEY_SLASH KEY_SPACE KEY_T KEY_TAB KEY_U KEY_UP KEY_V KEY_W
KEY_X KEY_Y KEY_Z  
Kernel driver detached  
Found 1 G13s  
command: bind G1 KEY_7  
command: bind G2 KEY_8  
command: bind G3 KEY_9  
command: bind G4 KEY_0  
command: bind G5 KEY_KPMINUS  
command: bind G6 KEY_Q  
command: bind G7 KEY_E  
command: bind G8 KEY_TAB  
command: bind G9 KEY_1  
command: bind G10 KEY_2  
command: bind G11 KEY_3  
command: bind G12 KEY_4  
command: bind G13 KEY_5  
command: bind G14 KEY_6  
command: bind G15 KEY_LEFTSHIFT  
command: bind G16 KEY_R  
command: bind G17 KEY_T  
command: bind G18 KEY_Y  
command: bind G19 KEY_F  
command: bind G20 KEY_LEFTALT  
command: bind G21 KEY_C  
command: bind G22 KEY_V  
command: bind L4 KEY_B  
command: bind L3 KEY_M  
command: bind MR KEY_F6  
command: bind M3 KEY_F5  
command: bind M2 KEY_F4  
command: bind M1 KEY_F3  
command: bind LEFT KEY_RIGHTBRACE  
command: bind DOWN KEY_SPACE  
command: bind STICK_LEFT KEY_A  
command: bind STICK_RIGHT KEY_D  
command: bind STICK_UP KEY_W  
command: bind STICK_DOWN KEY_S

At this point, you should have a working gamepad. If you do not map any keys by default all keys are mapped to 'a', I noticed the daemon would crash if left this way after a period of time. My assumption at the time(year+ ago) was due to having too many(or just >1) key mapped to the same. I never investigated/tested though, instead I started dumping my binds into the pipe before starting the daemon and the issue went away entirely. I haven't had an issue since(over a year). The only time the gamepad does not function is if I forget to start the daemon after a power cycle, or disconnect/reconnect the device.

Here is the current script I run after each time I restart my computer:

[jpyth@arch-jm ~]$ cat startG13.sh  
#!/bin/bash

ps aux | grep g13 | grep -v grep &>/dev/null && echo "Already running-
Exiting"|| {  
cat /home/jpyth/g13/wowBinds > /tmp/g13-0  
nohup /usr/bin/g13 &  
rm nohup.out  
}

Pretty crude, I know. I started to add it as a systemd process, but there is currently a bug in the daemon. If you disconnect the g13 the daemon goes into a tight loop failing to find the device. This will consume process, and will have to be restarted once the device is reconnected anyway. I didn't want to write a wrapper to babysit the daemon....I have another plan for it by adding a bit more to onConnect, when I get that working i'll share;).

more ...

'psg'

Introduced to this years ago by a colleague, but it's still my favorite little alias.

#Add to ~/.bashrc  
alias psg='ps aux | grep -v grep | grep -i'  
#Source the updated bashrc(or relog)  
source ~/.bashrc  
#I prefer to not be case sensitive, example:  
[jpyth@arch-jpyth ~]$ psg fire  
jpyth 16131 12.7 3.7 1463388 607748 ? Sl Mar25 367:33
/usr/lib/firefox/firefox  
[jpyth@arch-jpyth ~]$ psg FiRe  
jpyth 16131 12.7 3.7 1463388 607748 ? Sl Mar25 367:33
/usr/lib/firefox/firefox  
[jpyth@arch-jpyth ~]$
more ...

Configuring irssi

autoconnect:

#server section of ~/.irssi/config  
servers = (  
{  
address = "$hostname";  
chatnet = "IRCnet";  
port = "6667";  
autoconnect = "true";  
password = "$user:$pass";  
}  
);

irssi logging:

#Create directory for logs  
#Large storage drive == /storage/  
sudo ln -s /storage/irssi /var/log/  
#You'll probably want to own these files or atleast rw access.  
chown -R $owner:$group /storage/irrsi  
:::bash  
#in irssi run:  
/SET autolog ON  
/SET autolog_path /var/log/irssi/$tag/$0.log  
/save

logrotate:

#Contents of /etc/logrotate.d/irssi  
/var/log/irssi/*/*log {  
copytruncate  
compress  
notifempty  
missingok  
}

irssi-libnotify-git from Arch User Repository (AUR):

#For xfce4  
sudo pacman -S xfce4-notifyd  
#Get package from AUR  
wget
https://aur.archlinux.org/packages/ir/irssi-libnotify-git/irssi-libnotify-git.tar.gz  
Extract && cd  
tar -xvf irssi-libnotify-git.tar.gz  
cd irssi-libnotify-git  
#create package - Install missing deps  
makepkg || {  
#missing deps  
sudo pacman -S python2-gobject perl-html-parser  
}  
makepkg  
#install final package  
sudo pacman -U irssi-libnotify-git*.pkg.tar.xz  
#create directories if missing && symlink installed script for irssi
to use.  
mkdir -p ~/.irssi/scripts/autorun && ln -s
/usr/share/irssi/scripts/notify.pl ~/.irssi/scripts/autorun/  
#dep for notify-listener.py  
sudo pacman -S python2-dbus  
#start listener -- I do this when launching irc. You could start it
with systemd/init too.  
nohup notify-listener.py &

Simple script to grab current or start a new irssi:

#!/bin/bash

screenN="irssi"  
notify=\`which notify-listener.py\`  
irc=\`which irssi\`

ps aux | grep "$notify" | grep -v grep &>/dev/null || {  
nohup $notify &  
}  
ps aux | grep -i "$irc" | grep -v grep &>/dev/null || {  
screen -S $screenN $irc  
} && {  
screen -list | grep "$screenN" | wc -l | grep "\^1$" &>/dev/null &&
{  
screen -D $screenN  
screen -R $screenN  
} || {  
echo "You has too many/few irssis, check screen"  
}  
}

Enjoy

more ...