Skip to content

Instantly share code, notes, and snippets.

Pål F. Kristiansen paalfe

Block or report user

Report or block paalfe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paalfe
paalfe / CiscoKeyGen.py
Created May 17, 2015
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
View CiscoKeyGen.py
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
View vivaldi.key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFTBKn4BEAC7ErevA1MlE2Sux6TZ/4DjnD9qcpAFxHVAElw6yFdP123ORnaV
La+MV2yx7Kn6GSPjF9ET/+f2BPmE76QBK8LMfobbLRJuBtjs8v0ObhcaVqXuM0hk
GpqnYvyGO0OaZRT42/ca9+5LororcUesuyzmMwgDjlrr5bmpK4CsJausDPm7l5UC
5geTLXj9SfbXh9KUolCbRfliTyEBn7wXUARHQL9VYPSaV+stwF7f49shm+p+qN4R
aQTmjrx0z7rJ7SvYuhnVmJ3esq2eLlFDA73GaUieKjJk6hbmC+0ZFXqcMjpPTawr
KPP8Yyl8uVGALD1UTj+tIw0SSOvJeGWqYWnpkKL32igl2GWuEbbA0QdSefx5ECJ1
OM91A9eUtCM5Ox8VZGz8cZt6xWXU18Xeu+2KdFvpm0UJAc49Wez+66WXSduSplMB
@paalfe
paalfe / dirtyfix-readynas-os6-treestructure.sh
Created Feb 2, 2015
Dirty fix ReadyNAS OS6 treestructure permissions, users and groups! CAREFUL WITH THIS SCRIPT! ONLY USE IF YOU KNOW WHAT YOU ARE DOING! Transfer to your ReadyNAS with OS6, and execute via SSH.
View dirtyfix-readynas-os6-treestructure.sh
#!/bin/bash
cd / ;
chmod 777 apps ; chown root:root apps ;
chmod 755 bin ; chown root:root bin ;
chmod 755 boot ; chown root:root boot ;
chmod 755 data ; chown root:root data ;
chmod 755 dev ; chown root:root dev ;
chmod 755 etc ; chown root:root etc ;
chmod 755 frontview ; chown root:root frontview ;
@paalfe
paalfe / bdfix.sh
Last active Aug 29, 2015
From http://unices.bitdefender.com/2011/11/01/bitdefender-antivirus-scanner-for-unices/. As many BitDefender Antivirus Scanner for Unices users have noticed, attempting to run the command line tool (bdscan) or the GUI application will result in an unexpected segmentation fault. The issue is caused by an incompatibility between the latest antivir…
View bdfix.sh
#!/bin/bash
cat /opt/BitDefender-scanner/var/lib/scan/versions.dat.* | \
awk '/bdcore.so.linux/ {print $3}' | \
while read bdcore_so; do
touch /opt/BitDefender-scanner/var/lib/scan/$bdcore_so;
bdscan --update;
mv /opt/BitDefender-scanner/var/lib/scan/bdcore.so \
/opt/BitDefender-scanner/var/lib/scan/bdcore.so.old;
rm /opt/BitDefender-scanner/var/lib/scan/bdcore.so;
ln -s /opt/BitDefender-scanner/var/lib/scan/$bdcore_so \
@paalfe
paalfe / discover_session_bus_address.sh
Last active Aug 29, 2015
From http://askubuntu.com/questions/457016/how-to-change-gsettings-via-remote-shell. Set the DBUS_SESSION_BUS_ADDRESS environment variable. The following script helps to get the correct value of that variable. It requires name of the process, that is running on the desktop, on which we want to change the dbus settings. (There can be more than 1 …
View discover_session_bus_address.sh
#!/bin/bash
# Remember to run this script using the command "source ./filename.sh"
# Search these processes for the session variable
# (they are run as the current user and have the DBUS session variable set)
compatiblePrograms=( nautilus kdeinit kded4 pulseaudio trackerd )
# Attempt to get a program pid
for index in ${compatiblePrograms[@]}; do
@paalfe
paalfe / apt
Last active Aug 29, 2015
From http://askubuntu.com/a/445638/14551. Enable bash-completion for the apt command in Ubuntu 14.04. save to /usr/share/bash-completion/completions/apt, then run "source ~/.bashrc" to load the completion (takes a while till the bash-completion works!).
View apt
# Debian apt(8) completion -*- shell-script -*-
_apt()
{
local cur prev words cword
_init_completion || return
local special i
for (( i=0; i < ${#words[@]}-1; i++ )); do
if [[ ${words[i]} == @(list|search|show|update|install|remove|upgrade|full-upgrade|edit-sources|dist-upgrade|purge) ]]; then
@paalfe
paalfe / 50-plantronics.conf
Last active May 26, 2016
Plantronics headsets presents itself as an usb sound card, a mouse and a keyboard. This gives lockups of the mouse or constant mouse click actions. I have experienced this problem in Ubuntu 12.04 and Ubuntu 13.04 with Plantronics Savi W700 series and Plantronics Blackwire 700 series. To make X11 ignore the keyboard and mouse features, download t…
View 50-plantronics.conf
# Plantronics headsets presents itself as an usb sound card, a mouse and a keyboard.
# This gives lockups of the mouse or constant mouse click actions.
#
# To make X11 ignore the keyboard and mouse features, download this xorg.conf file to
# /usr/share/X11/xorg.conf.d/50-plantronics.conf
#
#
Section "InputClass"
Identifier "Plantronics"
MatchVendor "Plantronics"
@paalfe
paalfe / amd_remove_unsupported_watermark.sh
Created Jul 21, 2013
If you installed AMD Catalyst BETA Drivers and want to remove AMD Testing Use Only Watermark: http://tuxperience.blogspot.no/2012/12/remove-amd-testing-use-only-watermark.html
View amd_remove_unsupported_watermark.sh
#!/bin/sh
DRIVER=`find /usr/lib -name fglrx_drv.so`
echo "Come on AMD!"
for token in $DRIVER;do
echo "Removing AMD logo from "$token
for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER
You can’t perform that action at this time.