GTK icons missing using a window manager

13 November 2014

If you’re using a window manager, such as awesome or goomwwm, instead of a desktop environment, such as GNOME or XFCE, then you might have the issue of some GTK applications not looking quite right, a problem I had was with missing icons.

Before and after:

GTK Before and After

List all available icons themes:

ls ~/.icons/ /usr/share/icons/

You need to append the line, gtk-icon-theme-name = "-insert-theme-name-", to /etc/gtk-2.0/gtkrc or ~/.gtkrc-2.0.

echo "gtk-icon-theme-name = \"Humanity\"" >> /etc/gtk-2.0/gtkrc

The above command globally sets the theme to Humanity. The command is appended if the file exists, and creates it if not.


Wireshark Privileges

30 October 2014

Reconfigure wirehsark-common so that it allows non-root users to access the interface. Add the user to the wireshark group.

dpkg-reconfigure wireshark-common
usermod -a -G wireshark <user>

Done.


Flash Fullscreen Focus Fix

28 October 2014

To force flash to not exit full screen when focus is lost, edit the NET_ACTIVE_WINDOW, in libflashplayer.so

sudo sed -i 's/_NET_ACTIVE_WINDOW/__ET_ACTIVE_WINDOW/g' /usr/lib/firefox-addons/plugins/libflashplayer.so

GOOMWWM Keybinding

15 July 2014

Keyboard shortcuts become a thing of the past when you’re running a minimal window manager such as GOOMWWM. I decided to use XBindKeys, a grabbing keys program for X.

XBindKeys uses a configuration file, located at $HOME/.xbindkeysrc.

Contents of my .xbindkeysrc

"gnome-terminal"
  Mod2 + F12

You can create your own config, or have a default one generated for you.

xbindkeys --defaults > $HOME/.xbindkeysrc 

To get the correct key codes, you can use -k to identify key presses. It will open a blank window and output the command to be placed into your configuration file.

xbindkeys -k

XBindKeys should be easily found in your package manager.


iptables pcap log

23 March 2014

ULOG is the netfilter/iptables logging daemon. It connects to the netlink device of the Linux kernel and reads messages from the netfilter that get queued with the iptables ULOG target. It can output to plain text, MySQL, Postgres and PCAP.

Install with:

apt-get install ulogd-pcap 

Configure ulogd to output in PCAP format

 vim /etc/ulogd.conf

Un-comment plugin="/usr/lib/ulogd/ulogd_PCAP.so", restart ulog. Then add a log rule to iptables before the final drop rule.

-A INPUT -j ULOG

The PCAP log file should be located at /var/log/ulog/pcap.log


LaTeX Install .cls

20 March 2014

Installing a LaTeX class in three simple steps.

locate article.cls

Copy your .cls file to the same directory.

sudo cp yourclsfile.cls /usr/share/rest/of/the/path/from/above

Update the kpathsea database.

sudo texhash

MAC Spoofing

11 February 2014

There are times when you want to change your MAC address, be it for fun, by-passing time restrictions or for development reasons.

For Linux there is a nice small tool which does this for you. It’s called macchanger. You can download and compile it or install it with your package manager.

For example, on Debian/Ubuntu you can do:

sudo apt-get install macchanger

Make sure you are not connected to the network first, and bring down your interface. In this case it’s my wireless interface, you may want to use your ethernet, which might be eth0.

sudo ifconfig wlan0 down

Now we change the end of the MAC address which will change your address but keep the same vendor bytes. For more information about this read up on MAC addresses

sudo macchanger -e wlan0

Now bring the interface back up, and connect to the network using your network manager.

sudo ifconfig wlan0 up

Check if we still have the new address.

macchanger wlan0

You should see something like this, if your current address is different then all is good.

Permanent MAC: 00:2F:77:36:57:F4 (Intel Corporate)
Current   MAC: 00:2F:77:F4:CE:02 (Intel Corporate

MACSpoof-CLI


Script to get HTTP Headers

02 August 2013

The below script uses urllib2 to connect to the given URL(s) then prints out the HTTP headers.

http-server-header.py

#:/bin/python
import urllib2, sys

if len(sys.argv) == 1:
	print "Please feed me a URL...\n\n<3\n"
	sys.exit(0)

for url in sys.argv[1:]:
	r = urllib2.urlopen(url)
	print 'URL: ' + url + '\n' + str(r.info())

An example of it working is shown below. From a “security through obscurity” view, you’d want to conceal your HTTP server information.

$ python ~/http-server-header.py http://nationpigeon.com
URL: http://nationpigeon.com
Server: nginx/1.2.1
Date: Mon, 05 Aug 2013 01:10:19 GMT
Content-Type: text/html
Content-Length: 650
Last-Modified: Mon, 29 Jul 2013 08:46:57 GMT
Connection: close
Accept-Ranges: bytes

goomwwm startup applications and background

24 January 2013

I’ve been using Goomwwm on and off, but seeing as it’s post-new-yearness I’m going to give it a try full time.

To set the background, I decided to use feh.

Simply create a .goomwwmrc in your home directory.

# Background
exec /usr/bin/feh --bg-center /home/osaka/wallpaper.jpg

# Sart up applications
exec /usr/bin/lxpanel

That sets the background to an image in my home directory and start lxpanel up once goomwwm has started.

From here you should be able to work out how to start other applications. Simply prefix the application location with the command ‘exec’


Connect to Eduroam using wpa_supplicant

24 January 2013

I can never remeber how it’s meant to work, which normally results in lots of authentication errors and google queries.

Less: /etc/wpa_supplicant/wpa_supplicant_edu.conf

ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1

network={
        ssid="eduroam"
        key_mgmt=IEEE8021X WPA-NONE WPA-EAP
        eap=PEAP
        identity="abc1@uni.ac.uk"
        password="*****"
        #ca_cert="/location/of/cert" # This might not be required.
        phase2="auth=MSCHAPV2"
        priority=2
        auth_alg=OPEN
}

As this will contain your password make sure that only root has read access!

That’s all there is to it. But seeing as I have done this in Arch Linux I’ll include the extra steps taken to get it fully working.

Created a netcfg profile.

Less: /etc/network.d/wlan0-eduroam

CONNECTION="wireless"
INTERFACE=wlan0
SCAN="no"
SECURITY="wpa-config"
ESSID="eduroam"
IP="dhcp"
TIMEOUT=30
WPA_CONF="/etc/wpa_supplicant/wpa_supplicant_edu.conf"

You should now be able to connect to eduroam with netcfg wlan0-eduroam

And to make it auto connect you need to add the profile to /etc/conf.d/netcfg. See netcfg