Working Ninja
2016-01-21T22:03:11

Unable to boot after kernel (3.19) upgrade on Ubuntu. Here's the fix:

  1. Add copy_modules_dir kernel/ubuntu/i915 to /usr/share/initramfs-tools/hooks/framebuffer.
  2. Then run update-initramfs -k all -u.
  3. Profit.

Fix found here: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/1500751

2016-01-19T21:20:09
$ cd ~/bin
$ wget https://services.gradle.org/distributions/gradle-2.10-all.zip
$ unzip gradle-2.10-all.zip
$ ln -s gradle-2.10-all/bin/gradle gradle
$ source ~/.bashrc
2016-01-17T12:55:51

Here is a great resource to troubleshoot Windows Update:

https://support.microsoft.com/en-us/kb/2509997

2016-01-17T12:54:16

Error:

The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes.

Solution:

# dd if=/dev/zero of=/dev/sdb bs=2048

Source: http://askubuntu.com/questions/675649/unable-to-delete-usb-drive-partitions-block-size-error

2016-01-17T12:08:12

Use dmesg after plugging in your USB thumb drive to find the device name (/dev/sdb).

# umount /media/username/devicename
# dd bs=4M if=/path/to/filename.iso of=/dev/sdb

Note, do not output to a partition (e.g. /dev/sdb1). In the past this has created a loop device instead of copying the input file to the USB thumb drive.

2016-01-11T23:07:13

Forgot that one file to add during your last commit? Haven't pushed changes to a remote yet? Great! Easy fix:

$ git add forgotten_file
$ git commit --amend
2016-01-11T22:52:32

Note: the following commands drop all data from the database.

$ rm -rf db.sqlite3
$ rm -rf app/migrations/*
$ ./manage.py makemigrations --empty app
$ ./manage.py makemigrations
$ ./manage.py migrate
$ ./manage.py createsuperuser
2016-01-11T21:47:37

Print all digits in a string as one integer:

>>> string = "a1b2c3"
>>> integer = int(filter(str.isdigit, string))
>>> print integer
123
>>> type(integer)
<type 'int'>

Or, if you would like a list of all digits:

>>> string = "a1b2c3"
>>> import re
>>> integer_list = re.findall('\d+', string)
>>> print integer_list
['1', '2', '3']
>>> type(integer_list)
<type 'list'>
2016-01-03T18:09:00

lsusb shows us that—sure enough—Apple's IR receiver is being loaded on boot:

# lsusb
Bus 005 Device 002: ID 05ac:8242 Apple, Inc. Built-in IR Receiver

lsmod reveals hid_appleir is the module being loading for our remote. Let's blacklist it:

# echo 'blacklist hid_appleir' > /etc/modprobe.d/hid_appleir.conf
# depmod -ae
# update-initramfs -u
# reboot now

That should take care of it!

More helpful tips and explanation here: https://wiki.debian.org/KernelModuleBlacklisting

2015-12-30T20:50:04
if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0232323" #black
    echo -en "\e]P82B2B2B" #darkgrey
    echo -en "\e]P1D75F5F" #darkred
    echo -en "\e]P9E33636" #red
    echo -en "\e]P287AF5F" #darkgreen
    echo -en "\e]PA98E34D" #green
    echo -en "\e]P3D7AF87" #brown
    echo -en "\e]PBFFD75F" #yellow
    echo -en "\e]P48787AF" #darkblue
    echo -en "\e]PC7373C9" #blue
    echo -en "\e]P5BD53A5" #darkmagenta
    echo -en "\e]PDD633B2" #magenta
    echo -en "\e]P65FAFAF" #darkcyan
    echo -en "\e]PE44C9C9" #cyan
    echo -en "\e]P7E5E5E5" #lightgrey
    echo -en "\e]PFFFFFFF" #white
    clear #for background artifacting
fi

Source: https://askubuntu.com/questions/147462/how-can-i-change-the-tty-colors#153493