Skip to content

Instantly share code, notes, and snippets.

View dreadwarrior's full-sized avatar
📚
Currently totally into books 😊

tåmm¥ dreadwarrior

📚
Currently totally into books 😊
View GitHub Profile
@dreadwarrior
dreadwarrior / .vimrc
Last active August 29, 2015 14:04
~/.vimrc
" Enable filetype plugins
filetype plugin on
filetype indent on
" Highlight search results
set hlsearch
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
@dreadwarrior
dreadwarrior / size.sql
Created October 7, 2014 10:21
Table sizes in MySQL from CLI
SELECT
table_name AS "Table",
round(((data_length + index_length) / 1024 / 1024), 2) AS "Size in MB"
FROM
information_schema.TABLES
WHERE
table_schema = "$DB_NAME";
@dreadwarrior
dreadwarrior / wget
Last active August 29, 2015 14:08
wget crawling
wget --random-wait --span-hosts --page-requisites --mirror --convert-links -e robots=off --domains=example.org http://www.example.org
# http://stackoverflow.com/a/15849825
# http://superuser.com/a/341964
# http://stackoverflow.com/a/20063874
@dreadwarrior
dreadwarrior / .bashrc
Last active August 29, 2015 14:09
.bashrc
# ...
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
# ...
@dreadwarrior
dreadwarrior / watch.sh
Last active August 29, 2015 14:10 — forked from mikesmullin/watch.sh
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <[email protected]>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
@dreadwarrior
dreadwarrior / config
Created January 12, 2015 08:13
Terminator Gritt-Config
; path: ~/.config/terminator/config -- DELETE THIS LINE!
[global_config]
window_state = maximise
handle_size = 1
focus = system
title_inactive_fg_color = "#a7aba7"
suppress_multiple_term_dialog = True
borderless = True
title_receive_bg_color = "#3a81cc"
title_transmit_bg_color = "#3a81cc"
@dreadwarrior
dreadwarrior / gnome-shell.css
Last active August 29, 2015 14:13
Small Gnome Shell Adjustments
stage {
font-family: 'Liberation Sans';
font-size: 10pt;
}
.list-search-result-title {
font-size: 10pt;
}
@dreadwarrior
dreadwarrior / analyze.sql
Created January 19, 2015 16:07
Analyse useless MySQL indexes
-- source: http://de.slideshare.net/techdude/how-to-kill-mysql-performance page 40
SELECT
t.TABLE_SCHEMA
, t.TABLE_NAME
, s.INDEX_NAME
, s.COLUMN_NAME
, s.SEQ_IN_INDEX
, (
SELECT
MAX(SEQ_IN_INDEX)
@dreadwarrior
dreadwarrior / howto
Created January 28, 2015 20:30
How to install latest gitg in #Debian testing
~$ sudo apt-get install libwebkit2gtk-3.0-25
# download deb package from http://debian.mirror.lrz.de/debian/pool/main/g/gitg/
# e.g. http://debian.mirror.lrz.de/debian/pool/main/g/gitg/gitg_3.14.1-1_amd64.deb
~$ sudo dpkg -i gitg_3.14.1-1_amd64.deb
@dreadwarrior
dreadwarrior / 000-SSH+Firewall
Last active August 29, 2015 14:22
Linux Server Diary
1. Change root password after server provision
2. Create unprivileged user
3. Create SSH key pair on client machine and ssh-copy-id to user
4. Adjust /etc/ssh/sshd_config:
PermitRootLogin no
PubkeyAuthentication yes
AllowUsers %user%
PasswordAuthentication no
TCPKeepAlive no
UsePAM no