Skip to content

Instantly share code, notes, and snippets.

View arlimus's full-sized avatar

Dominik Richter arlimus

View GitHub Profile
@arlimus
arlimus / Christmas songs
Last active December 24, 2022 09:07
Guess the song (German and English)
⏪🎄
🤫🌃👼🌃
0🎄
🔴👃🏽🦌
❄⚪👗
🤫🌨
0😀
🧒🏽🧒🏻🏃🏽‍♂️
🚗🏡4🎄
🛎🔔🛎🛎
@arlimus
arlimus / gitconfig
Last active May 17, 2021 18:36
my gitconfig configuration
# git config; arlimus, public domain
## Make your adjustments
########################
[user]
name = Your Name
email = your.name@email.com
[core]
@arlimus
arlimus / i3.conf
Last active January 29, 2018 08:39
i3 configuration
# arlimus i3 config; public domain
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+r exec TERMINAL=xfce4-terminal i3-sensible-terminal
@arlimus
arlimus / essential vim
Last active November 17, 2017 16:23
vim.essential.md
Personal most used commands in vim (VSCode, Atom, ... any editor really)
# motion.txt
y c d ... yank / change / delete
v V ... visual mode character-wise/Line-wise
< > ... indent and outdent
/ ? ... search forward or backwards,
eg "/word" => go to "word"
@arlimus
arlimus / ssh tunnelling vagrant env
Last active November 17, 2017 16:09
Experiment with remote SSH tunnels and forwarding. Vagrant environment. See http://arlimus.github.io/articles/ssh.reverse.tunnel.security
# -*- mode: ruby -*-
# vi: set ft=ruby :
name = 'saucy'
IP = {
'saucy' => '192.168.123.123',
'client1' => '192.168.123.101',
'client2' => '192.168.123.102'
}
@arlimus
arlimus / gitlab-28-to-64.sh
Last active January 2, 2016 21:39
Upgrading gitlab data from caveman to modern age.
## prerequisite:
## deploy https://github.com/ogom/cookbook-gitlab
## have repos in place (/home/git/repositories)
## have data in mysql
service gitlab stop
# we need ruby1.9.1 for old gitlab migration...
apt-get install -y libpq-dev ruby1.9.1 ruby1.9.1-dev
update-alternatives --set ruby /usr/bin/ruby1.9.1
@arlimus
arlimus / git-tricks.sh
Created October 4, 2013 10:00
Git tricks
# get the SHA hash of the first commit in your git repo
git log --pretty=format:%H | tail -n1
# put version 0.0 tag onto the first commit in your git repo
git tag 0.0 $(git log --pretty=format:%H | tail -n1 )
@arlimus
arlimus / print_characters.rb
Last active December 24, 2015 12:39
Find your favorite unicode character quickly, print them to console
# define the printer
def p_uni(range); r = Array(range); return if r.empty?; puts r[0..79].pack("U*").gsub(/\p{^Print}/,''); p_uni(r[80..-1]); end
# use it
p_uni(0x30..0x2e50)
# this will give you:
# 0123456789:;<=>?@ABCDEFGHIJKLMNO...
# ...
# ⸠⸡⸢⸣⸤⸥⸦⸧⸨⸩⸪⸫⸬⸭⸮
@arlimus
arlimus / minify.rb
Created August 21, 2013 17:30
Minify images (jpg/png) in the current folder to smaller sizes (up to ~350k). Example run: > minify -- converting with quality 70, resize 100% 134 (25).png -- converting with quality 70, resize 100% -- converting with quality 70, resize 84% 144 .jpeg > ll minified -rw-r--r-- 1 zhaery users 130K 21. Aug 19:33 134 (25).png.jpg -rw-r--r-- 1 zhaery …
#!/usr/bin/env ruby
require 'fileutils'
threshold = 350e3
$output = "minified"
$quality = 70
FileUtils.mkdir_p $output
def conv org, factor = 1.0
puts "-- converting with quality #{$quality}, resize #{(factor*100).round}%"
@arlimus
arlimus / pacman_aur.sh
Last active December 16, 2015 11:48
One-liner to install a package from AUR. Does not resolve dependencies!
# short version, just copy-and-paste this line:
pacman_aur(){ for pn in $*; do rm -rf /tmp/$pn; mkdir -p /tmp/$pn; pushd /tmp/$pn; wget https://aur.archlinux.org/packages/${pn:0:2}/$pn/PKGBUILD; makepkg; popd; done; sudo pacman -U $(for i in $*; do echo /tmp/$i/*.tar.xz; done;); }
# install yaourt on a fresh arch:
# 1. get requirements
pacman -S base-devel yajl sudo
# 2. make sure your user is added to sudoers
# as root: visudo
# 3. install package-query and yaourt from aur
pacman_aur package-query yaourt