Skip to content

Instantly share code, notes, and snippets.

@paalfe
paalfe / amd_remove_unsupported_watermark.sh
Created July 21, 2013 00:52
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
#!/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
@paalfe
paalfe / 50-plantronics.conf
Last active January 16, 2021 13:18
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…
# 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 / apt
Last active August 29, 2015 14:00
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!).
# 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 / discover_session_bus_address.sh
Last active August 29, 2015 14:00
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 …
#!/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 / bdfix.sh
Last active August 29, 2015 14:00
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…
#!/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 / dirtyfix-readynas-os6-treestructure.sh
Created February 2, 2015 15:20
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.
#!/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 / CiscoKeyGen.py
Created May 17, 2015 20:45
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 ".
#! /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()