Skip to content

Instantly share code, notes, and snippets.

View yackermann's full-sized avatar
🎯

Ackermann Yuriy yackermann

🎯
View GitHub Profile
@yackermann
yackermann / example.com.conf
Last active December 10, 2015 00:33
Nice and quick SSL setup.
# Rewrites HTTP to HTTPS
<VirtualHost *:80>
ServerName example.com
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
sudo apt-get install rbenv ruby
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
@yackermann
yackermann / SoT.attendeePageFix.js
Created March 31, 2016 01:36
SoT Attendee page fix
$('table > tbody > tr').each( function( key, value ){
var input_tr = $(value).find('input').parent();
$(this).prepend(input_tr);
var tds = $(value).find('td');
$(tds[3]).remove();
$(tds[4]).remove();
})
$('thead > tr').each( function( key, value ){
@yackermann
yackermann / niemand.zsh-theme
Last active June 30, 2016 03:44
My Oh-My-ZSH theme
# Arrow
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
# Returns location to second point
local location="%{$fg_bold[cyan]%}%2~"
PROMPT='%{$fg_bold[green]%}%p%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}${ret_status}'
RPS1='${location} %{$fg_bold[blue]%}%m%{$reset_color%}'
@yackermann
yackermann / English_language_frequency_table.json
Created April 30, 2016 04:25
Frequency table for English language
{ "e": 0.12702, "t": 0.9056, "a": 0.8167, "o": 0.7507, "i": 0.6966, "n": 0.6749, "s": 0.6327, "h": 0.6094, "r": 0.5987, "d": 0.4253, "l": 0.4025, "c": 0.2782, "u": 0.2758, "m": 0.2406, "w": 0.2361, "f": 0.2228, "g": 0.2015, "y": 0.1974, "p": 0.1929, "b": 0.1492, "v": 0.0978, "k": 0.0772, "j": 0.0153, "x": 0.0150, "q": 0.0095, "z": 0.0074 }
@yackermann
yackermann / u2f_reg.sh
Created May 14, 2016 01:36
U2F Examples
#!/usr/bin/env bash
echo "Asking for challenge for user $1..."
curl -s "https://demo.yubico.com/wsapi/u2f/enroll?username=$1&password=$2" > reg_challenge
cat reg_challenge
echo $'\n'
echo "Asking U2F key for signature..."
u2f-host -aregister -o https://demo.yubico.com < reg_challenge > reg_response
cat reg_response

Keybase proof

I hereby claim:

  • I am herrjemand on github.
  • I am herrjemand (https://keybase.io/herrjemand) on keybase.
  • I have a public key ASBG32fx3Au5E4a03NO6nCTZ33pmIGnrpEKexrk5sQ30JAo

To claim this, I am signing this object:

@yackermann
yackermann / gitignore.sh
Created June 22, 2016 09:41
https://www.gitignore.io/ gitignore generation script
function gitignore() {
if [ -z "$1" ]
then
echo "No argument supplied"
else
DATA=$(curl -s -L "https://www.gitignore.io/api/$1")
if [[ $DATA == *"ERROR"* ]]
then
function pdfpextr()
{
# this function uses 3 arguments:
# $1 is the first page of the range to extract
# $2 is the last page of the range to extract
# $3 is the input file
# output file will be named "inputfile_pXX-pYY.pdf"
OLD_FILENAME=$3
NEW_FILENAME=${3%.pdf}.${1}.pdf
@yackermann
yackermann / all_areas.js
Last active October 5, 2016 10:16
Select specific Wellington areas at Trademe.co.nz
var all_areas = ["Aro Valley",
"Berhampore",
"Breaker Bay",
"Broadmeadows",
"Brooklyn",
"Chartwell",
"Churton Park",
"Crawford",
"Crofton Downs",
"Evans Bay",