mkdir -p ~/bin
cd ~/bin
curl -sSL http://deis.io/deisctl/install.sh | sh -s 1.2.0
curl -sSL http://deis.io/deis-cli/install.sh | sh -s 1.2.0(optional) install for all users
| import operator as op | |
| class A: | |
| def test(self): | |
| return "self.test()" | |
| def test2(self,arg): | |
| return "self.test2({arg})".format(arg=arg) | |
| alist = map(lambda i: A(), range(10)) | |
| ans = map(op.methodcaller('test'), alist) |
| // Conway's Game of Life for HTML5 Canvas | |
| // By Simon Laroche | |
| var FPS = 5; | |
| var paused = true; | |
| var gameStarted = false; | |
| var gLoop; | |
| var generations = 0; | |
| var population = 0; |
| # Install ARCH Linux with encrypted file-system and UEFI | |
| # The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
| # Download the archiso image from https://www.archlinux.org/ | |
| # Copy to a usb-drive | |
| dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
| # Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
| # Set swedish keymap |
| # Released by rdb under the Unlicense (unlicense.org) | |
| # Based on information from: | |
| # https://www.kernel.org/doc/Documentation/input/joystick-api.txt | |
| import os, struct, array | |
| from fcntl import ioctl | |
| # Iterate over the joystick devices. | |
| print('Available devices:') |
| #!/usr/bin/python | |
| ''' | |
| A Simple mjpg stream http server for the Raspberry Pi Camera | |
| inspired by https://gist.github.com/n3wtron/4624820 | |
| ''' | |
| from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
| import io | |
| import time | |
| import picamera |
| #!/usr/bin/env python | |
| from __future__ import print_function, division | |
| from operator import itemgetter | |
| import sys | |
| import json | |
| def json_filter(filter_keys, data): |
| function docker_debug { ([[ "$1" =~ ":" ]] || (echo "Failed. Specify tag" && false)) && echo -e "FROM $1\nUSER root\nRUN apt-get install --assume-yes ipython htop tcptrack tmux man\nRUN pip install cqlsh" | docker build -t $1-dbg - && docker run -it ${*:2} $1-dbg bash;}; |
| sudo pacman -S polkit wpa_actiond | |
| systemctl enable [email protected] |
| #!/usr/bin/env bash | |
| set -ex | |
| input_image=$1 | |
| output_image=$2 | |
| ## Example usage: ./convert_to_favicon.sh icon.svg favicon.ico | |
| for d in 16 32; do | |
| convert -resize ${d}x${d} -flatten -colors 256 ${input_image} /tmp/favicon-${d}.ico | |
| done |