Dogecoin Ubuntu Live CD Installer

I spent a little time today trying to come up with a single tar file and script to install dogecoin-qt on an Ubuntu live CD. This will let fellow shibes make offline wallets for better security!

You can get the code and instructions from my github here.

This version is created for 64-bit Ubuntu 12.04 Live CD. I likely have too many deps in the tar file as it is quite huge(~80MB), but it works! I'll work on shaving it down soon.

Here is what it looks like in action:

[shibe@ubuntu mnt]$ sudo tar -xvf
dogecoin-qt-1.5-ubuntu-12.04-Live-Install.tar  
dogecoin-qt-1.5-ubuntu-12.04-Live-Install/

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-xml_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libx11-6_2%3a1.4.99.1-0ubuntu2.2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libssl1.0.0_1.0.1-4ubuntu5.11_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-system1.48.0_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdrm-dev_2.4.46-1ubuntu0.0.0.1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-system1.48-dev_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqtwebkit-dev_2.2.1-1ubuntu4_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-scripttools_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/x11proto-input-dev_2.3-1~precise1_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/gcc-4.4_4.4.7-1ubuntu2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/qt4-linguist-tools_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libstdc++6-4.6-dev_4.6.3-1ubuntu5_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdrm-intel1_2.4.46-1ubuntu0.0.0.1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libalgorithm-merge-perl_0.08-2_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdrm2_2.4.46-1ubuntu0.0.0.1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdb++-dev_5.1.4ubuntu1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdb5.1++-dev_5.1.25-11build1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libglu1-mesa_8.0.4-0ubuntu0.7_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/x11proto-kb-dev_1.0.5-2_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libxcb1-dev_1.8.1-1ubuntu0.2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/g++-4.6_4.6.3-1ubuntu5_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-qt3support_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqtcore4_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-filesystem1.48-dev_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/x11proto-xext-dev_7.2.0-3_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-date-time1.48-dev_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/g++-4.4_4.4.7-1ubuntu2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-sql_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/qt4-qmake_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/zlib1g-dev_1%3a1.2.3.4.dfsg-3ubuntu4_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libtimedate-perl_1.2000-1_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libkms1_2.4.46-1ubuntu0.0.0.1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-script_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/cpp-4.4_4.4.7-1ubuntu2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libx11-doc_2%3a1.4.99.1-0ubuntu2.2_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libgl1-mesa-dev_8.0.4-0ubuntu0.7_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/x11proto-core-dev_7.0.22-1ubuntu0.1_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-svg_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libxext-dev_2%3a1.3.0-3ubuntu0.1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-designer_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libpthread-stubs0_0.3-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libxau-dev_1%3a1.0.6-4_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-serialization1.48.0_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqtgui4_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/mesa-common-dev_8.0.4-0ubuntu0.7_amd64.deb  
dogecoin-qt-1.5-ubuntu-12.04-Live-Install/xtrans-dev_1.2.6-2_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdrm-radeon1_2.4.46-1ubuntu0.0.0.1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-date-time1.48.0_1.48.0-3_amd64.deb  
dogecoin-qt-1.5-ubuntu-12.04-Live-Install/dogecoin-master-1.5.zip

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libx11-dev_2%3a1.4.99.1-0ubuntu2.2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-dev_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-opengl-dev_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdrm-nouveau2_2.4.46-1ubuntu0.0.0.1_amd64.deb  
dogecoin-qt-1.5-ubuntu-12.04-Live-Install/j

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libpthread-stubs0-dev_0.3-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libglu1-mesa-dev_8.0.4-0ubuntu0.7_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdrm-nouveau1a_2.4.46-1ubuntu0.0.0.1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libstdc++6-4.4-dev_4.4.7-1ubuntu2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/dpkg-dev_1.16.1.2ubuntu7.2_all.deb  
dogecoin-qt-1.5-ubuntu-12.04-Live-Install/install.sh

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdb5.1++_5.1.25-11build1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqtwebkit4_2.2.1-1ubuntu4_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-network_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libalgorithm-diff-xs-perl_0.04-2build2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-help_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-thread1.48-dev_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/build-essential_11.5ubuntu2.1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-test_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-sql-sqlite_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libssl-doc_1.0.1-4ubuntu5.11_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/qdbus_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-chrono1.48.0_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libxdmcp-dev_1%3a1.1.0-4_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/g++_4%3a4.6.3-1ubuntu5_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-serialization1.48-dev_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-filesystem1.48.0_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost1.48-dev_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-chrono1.48-dev_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-program-options1.48.0_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdpkg-perl_1.16.1.2ubuntu7.2_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libminiupnpc-dev_1.6-3ubuntu1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-xmlpatterns_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libssl-dev_1.0.1-4ubuntu5.11_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-dbus_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-thread1.48.0_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-declarative_4%3a4.8.1-0ubuntu4.6_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libalgorithm-diff-perl_1.19.02-2_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/gcc-4.4-base_4.4.7-1ubuntu2_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/xorg-sgml-doctools_1%3a1.10-1_all.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libdb5.1-dev_5.1.25-11build1_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libboost-program-options1.48-dev_1.48.0-3_amd64.deb

dogecoin-qt-1.5-ubuntu-12.04-Live-Install/libqt4-opengl_4%3a4.8.1-0ubuntu4.6_amd64.deb  
[shibe@ubuntu mnt]$ cd dogecoin-qt-1.5-ubuntu-12.04-Live-Install  
[shibe@ubuntu dogecoin-qt-1.5-ubuntu-12.04-Live-Install]$
./install.sh  
First step to the moon in(much time needed)  
3  
2  
1  
##Lots of stuff.. This will take a while.

Here is the install.sh script to install the deps, extract and compile the source code for dogecoin-qt.

[shibe@ubuntu dogecoin-qt-1.5-ubuntu-12.04-Live-Install]$ cat
install.sh

#!/bin/sh

#Check jpyth.com or github.com/jpyth for any updates should dogecoin-qt
have a newer version! To the moon!

echo "First step to the moon in(much time needed)"  
echo "3"  
sleep 1  
echo "2"  
sleep 1  
echo "1"  
sleep 1  
dpkg -i *deb && {  
echo "Files need"  
unzip dogecoin-master-1.5.zip && {  
cd dogecoin-master-1.5 && {  
echo "funny make"  
ls  
qmake && {  
echo "make time"  
ls  
make && {  
echo "Much Finish, 'cd dogecoin-master-1.5; ./dogecoin-qt' to run
dogecoin! To the moon!"  
} || {  
echo "Fail much make, much sad. Report logs above."  
}  
} || {  
echo "Fail much qmake, much sad. Report. "  
}  
} || {  
echo "Moving too hard"  
}  
} || {  
echo "Much weird, dogecoin-master-1.5.zip much sad"  
}  
} || {  
echo "dpkg no like, find a shibe to help with errors above!"  
}  
[shibe@ubuntu dogecoin-qt-1.5-ubuntu-12.04-Live-Install]$

Nothing special, just going through each step and checking return code on the prior step. Hopefully most of those error messages are never seen by anyone.

If you find any deps that are missing, or know of ones I can remove please let me know. I'll write up information about creating the live CD, other steps, and dogecoin in general...but wanted to share this as I promised it on reddit.

To the moon!

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 ...

Wireshark Fun

Quick and dirty way to configure a wireless router(Airport Express), to use your linux pc as a network gateway. I needed to sniff the network of some wireless devices, which can be quite handy.

You'll need to do a few things:
1.) Enable IP Forwarding
2.) Configure iptables to nat/forward traffic from in one interface and out another
3.) Bridge the device, and use dhcpd to handle dhcp for the devices(Much easier to track)

Enable IP Forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

Configure iptables(as root):

#Interface you are sending traffic out(eth0)  
#Going out usb-ethernet  
iptables --table nat --append POSTROUTING --out-interface eth0 -j
MASQUERADE  
#Going out my wireless  
iptables --table nat --append POSTROUTING --out-interface wlp8s0 -j
MASQUERADE

#Interface you are forwarding traffic from(Airport hooked to this
interface)  
iptables --append FORWARD --in-interface enp7s0 -j ACCEPT

Configure dhcpd4 to hand out dhcpcd on enp7s0

#Replace xxx IP with valid dns servers.  
[jmorgan@arch-dopey ~]$ cat /etc/dhcpd.conf  
option domain-name "arch-dopey.com";  
option domain-name-servers xxx.xxx.xxx, xxx.xxx.xxx;  
default-lease-time 14440;  
ddns-update-style none;  
deny bootp; shared-network airport {  
subnet 10.0.0.0 netmask 255.255.255.0 {  
option routers 10.0.0.1;  
option subnet-mask 255.255.255.0;  
pool { range 10.0.0.10 10.0.0.20; }  
}  
}  
#start dhcpd4  
[jmorgan@arch-dopey ~]$ sudo systemctl start dhcpd4

Launch wireshark, and watch traffic from the interface you are forwarding from(enp7s0 for me).

Enjoy

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 ...

Starting Wireless On Boot With systemd

I didn't want to use a GUI to manage my wireless network. Majority of the time I will be at known locations, and when needing to join a new network doing it via command line is not difficult.

I have known networks configured, with dhcpcd and wpa_supplicant started during bootup by systemd. I also chose to log, and rotate, wpa_supplicant to help debug any network issues I might encounter. The following was done in Arch.

A few files must exist, the first is a .service file under /usr/lib/systemd/system/. The Type=forking is required since we are starting a daemon, the PIDFile is optional. If you include it, make sure you actually create a pid file when starting the process.

#cat /usr/lib/systemd/system/wireless.service  
[Unit]  
Description=Wireless

[Service]  
Type=forking  
PIDFILE=/var/run/wireless.pid  
ExecStart=/usr/lib/systemd/scripts/wirelessStart  
ExecReload=/usr/lib/systemd/scripts/wirelessRestart  
ExecStop=/usr/lib/systemd/scripts/wirelessStop

[Install]  
WantedBy=multi-user.target

I chose to make individual Start, Restart and Stop scripts as seen above. You may do this differently. Here are mine:

#Start Script  
#cat /usr/lib/systemd/scripts/wirelessStart  
#!/bin/bash  
ps aux | grep wpa_supplicant | grep -v grep &>/dev/null || {  
wpa_supplicant -f /var/log/wpa_supplicant/wpa_supplicant.log -B -i
wlp8s0 -P/var/run/wireless.pid -c /etc/wpa_supplicant.conf -d  
}

#Stop Script - I haven't had an issue with pkill failing to get the job done.  
#cat /usr/lib/systemd/scripts/wirelessStop  
#!/bin/bash  
pkill wpa_supplicant

#Restart Script  
#cat /usr/lib/systemd/scripts/wirelessRestart  
#!/bin/bash  
/usr/lib/systemd/scripts/wirelessStop  
sleep 3  
/usr/lib/systemd/scripts/wirelessStart

logrotate:

#cat /etc/logrotate.d/wpa_supplicant  
/var/log/wpa_supplicant/*log {  
copytruncate  
compress  
notifempty  
missingok  
}

Enabling the new service, and checking status:

#enable the service  
[jpyth@arch-jpyth ~]$ sudo systemctl enable wireless  
ln -s '/usr/lib/systemd/system/wireless.service'
'/etc/systemd/system/multi-user.target.wants/wireless.service'  
#start the service  
[jpyth@arch-jpyth ~]$ sudo systemctl start wireless  
#status of service  
[jpyth@arch-jpyth ~]$ sudo systemctl status wireless  
wireless.service - Wireless  
Loaded: loaded (/usr/lib/systemd/system/wireless.service; enabled)  
Active: active (running) since Wed 2013-03-27 07:29:19 PDT; 3s ago  
Process: 1574 ExecStart=/usr/lib/systemd/scripts/wirelessStart
(code=exited, status=0/SUCCESS)  
Main PID: 1579 (wpa_supplicant)  
CGroup: name=systemd:/system/wireless.service  
└─1579 wpa_supplicant -f /var/log/wpa_supplicant/wpa_supplicant.log
-B -i wlp8s0 -P/var/run/wireless.pid -c /etc/wpa_supplicant.conf -d

Mar 27 07:29:18 arch-jpyth systemd[1]: Starting Wireless...  
Mar 27 07:29:19 arch-jpyth systemd[1]: Started Wireless.  
[jpyth@arch-jpyth ~]$ psg wpa_supplican  
root 1579 0.0 0.0 32328 1344 ? Ss 07:29 0:00 wpa_supplicant -f
/var/log/wpa_supplicant/wpa_supplicant.log -B -i wlp8s0
-P/var/run/wireless.pid -c /etc/wpa_supplicant.conf -d  
#log file  
[jpyth@arch-jpyth ~]$ tail
/var/log/wpa_supplicant/wpa_supplicant.log  
EAP: EAP entering state DISABLED  
EAPOL: SUPP_PAE entering state AUTHENTICATED  
EAPOL: Supplicant port status: Authorized  
EAPOL: SUPP_BE entering state IDLE  
EAPOL authentication completed successfully  
RTM_NEWLINK: operstate=1 ifi_flags=0x11043
([UP][RUNNING][LOWER_UP])  
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlp8s0' added  
WEXT: if_removed already cleared - ignore event  
EAPOL: startWhen --> 0  
EAPOL: disable timer tick  
[jpyth@arch-jpyth ~]$

*note if you need dhcpcd enable/verify:

#enable the service  
[jpyth@arch-jpyth ~]$ sudo systemctl enable dhcpcd  
ln -s '/usr/lib/systemd/system/dhcpcd.service'
'/etc/systemd/system/multi-user.target.wants/dhcpcd.service'  
#start the service  
[jpyth@arch-jpyth ~]$ sudo systemctl start dhcpcd  
#status of the service  
[jpyth@arch-jpyth ~]$ sudo systemctl status dhcpcd  
dhcpcd.service - dhcpcd on all interfaces  
Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service; enabled)  
Active: active (running) since Wed 2013-03-27 07:32:06 PDT; 4s ago  
Process: 1697 ExecStart=/sbin/dhcpcd -q -b (code=exited,
status=0/SUCCESS)  
Main PID: 1698 (dhcpcd)  
CGroup: name=systemd:/system/dhcpcd.service  
└─1698 /sbin/dhcpcd -q -b

Mar 27 07:32:06 arch-jpyth systemd[1]: Started dhcpcd on all
interfaces.  
Mar 27 07:32:06 arch-jpyth dhcpcd[1698]: wlp8s0: sending IPv6 Router
Solicitation  
Mar 27 07:32:06 arch-jpyth dhcpcd[1698]: wlp8s0: rebinding lease of
192.168.1.42  
Mar 27 07:32:06 arch-jpyth dhcpcd[1698]: enp7s0: waiting for carrier  
Mar 27 07:32:06 arch-jpyth dhcpcd[1698]: wlp8s0: acknowledged
192.168.1.42 from 192.168.1.1  
Mar 27 07:32:06 arch-jpyth dhcpcd[1698]: wlp8s0: checking for
192.168.1.42  
Mar 27 07:32:10 arch-jpyth dhcpcd[1698]: wlp8s0: sending IPv6 Router
Solicitation  
[jpyth@arch-jpyth ~]$
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 ...


Welcome

A self taught, constantly learning geek living the dream in Silicon Valley.

The majority of configuration content on this site will come from either Arch or CentOS, though concepts should apply to nearly any Linux system.

more ...