- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
| NOTE: HTTP SSL keys are all in PEM format (base64 encoded) | |
| #From PEM format to DER | |
| openssl x509 -in $1.crt -out $1.der -outform DER | |
| #From DER format to PEM | |
| openssl x509 -in $1.der -inform DER -out $1.pem -outform PEM | |
| #Transforming RSA key to DER format | |
| openssl rsa -in oberon.key -inform PEM -out oberon_key.der -outform DER |
rsync (Everyone seems to like -z, but it is much slower for me)
| # Use LVM for partitioning | |
| d-i partman-auto/method string lvm | |
| # If one of the disks that are going to be automatically partitioned | |
| # contains an old LVM configuration, the user will normally receive a | |
| # warning. Preseed this away | |
| d-i partman-lvm/device_remove_lvm boolean true | |
| # And the same goes for the confirmation to write the lvm partitions. | |
| d-i partman-lvm/confirm boolean true |
| #!/usr/bin/env python | |
| from scapy.all import * | |
| ap_list = [] | |
| def PacketHandler(pkt) : | |
| if pkt.haslayer(Dot11) : | |
| if pkt.type == 0 and pkt.subtype == 8 : |
| #!/bin/bash | |
| UP=$(pgrep mysql | wc -l); | |
| if [ "$UP" -ne 1 ]; | |
| then | |
| echo "MySQL is down."; | |
| sudo service mysql start | |
| else | |
| echo "All is well."; | |
| fi |
| #!flask/bin/python | |
| from flask import Flask, jsonify, abort, request, make_response, url_for | |
| from flask_httpauth import HTTPBasicAuth | |
| app = Flask(__name__, static_url_path = "") | |
| auth = HTTPBasicAuth() | |
| @auth.get_password | |
| def get_password(username): | |
| if username == 'miguel': |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/usr/bin/python | |
| ############################################################################### | |
| # | |
| # file: gmail-count | |
| # | |
| # Purpose: generates a string value representing the Gmail unread email count. | |
| # | |
| # Usage: pipe the i3status with this script (see i3status manpage) | |
| # or use conky. | |
| # |
| # Sane settings for Gnome | |
| gsettings set org.gnome.desktop.background show-desktop-icons true | |
| gsettings set org.gnome.desktop.interface clock-show-date true | |
| gsettings set org.gnome.settings-daemon.plugins.xsettings antialiasing 'grayscale' | |
| gsettings set org.gnome.settings-daemon.plugins.xsettings hinting 'slight' | |
| gsettings set org.gnome.desktop.interface text-scaling-factor '1.0' | |
| gsettings set org.gnome.desktop.interface monospace-font-name "Monospace 10" | |
| gsettings set org.gnome.desktop.interface document-font-name 'Sans 10' | |
| gsettings set org.gnome.desktop.interface font-name 'Cantarell 10' | |
| gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita' |