This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PS3="Choose device: " | |
select dev in /dev/sd? | |
do | |
echo you picked device $dev \($REPLY\) | |
break | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mount -t proc none /mnt/chroot/proc | |
mount -o bind /dev /mnt/chroot/dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __return_value() | |
{ | |
ret=$? | |
if [[ "$ret" -ne "0" ]]; then | |
echo -e "\033[1;31m[Error: \033[0;31m$ret\033[1;31m]\033[00m" | |
fi | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Swap Alt and Cmd keys. | |
keycode 37 = Control_L | |
keycode 49 = less greater less greater backslash brokenbar bar | |
keycode 133 = Alt_L Meta_L | |
keycode 64 = Super_L | |
keycode 108 = Super_R | |
keycode 134 = ISO_Level3_Shift Multi_key | |
keycode 105 = Control_R Multi_key | |
clear Shift | |
clear Lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcc -Wall -o union union.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
T ConvertString( const std::string &data ) | |
{ | |
if( !data.empty( )) | |
{ | |
T ret; | |
std::istringstream iss( data ); | |
if( data.find( "0x" ) != std::string::npos ) | |
{ | |
iss >> std::hex >> ret; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g++ -o for for.cpp -std=c++0x -Wall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data | |
hello: | |
.string "Hallo, Welt!\n" | |
.text | |
.global _start | |
_start: | |
movl $4, %eax /* write() */ | |
movl $1, %ebx /* 1 = stdout */ | |
movl $hello, %ecx /* Adresse von hello */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.2 | |
import itertools | |
print( list( itertools.permutations( [1, 2, 3, 4], 2) ) ) |