Skip to content

Instantly share code, notes, and snippets.

Christoffer Aasted dezza

  • <RADAR OFFLINE>
Block or report user

Report or block dezza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dezza
dezza / colortest.sh
Created Mar 28, 2018
Original colortest? Or better hehe.
View colortest.sh
#!/bin/bash
T='gYw' # The test text
echo "Background: 0 1 2 3 4 5 6 7"
echo "Foreground:"
for FG in 0 1 2 3 4 5 6 7
do
echo -en " ${FG} $(tput setaf ${FG}) $T "
@dezza
dezza / zcompile.zsh
Last active Oct 20, 2017
/.zsh/modules/zcompile.zsh
View zcompile.zsh
#!/usr/bin/env zsh
if (( ${+ZSH_COMPILE_LOCK} )); then
return
fi
export ZSH_COMPILE_LOCK=1
zcompare() {
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
zcompile ${1}
@dezza
dezza / build-zsh.sh
Created Sep 16, 2017 — forked from thiagokokada/build-zsh.sh
Build last stable version of ZSH from sources on Ubuntu, or any other version with small changes
View build-zsh.sh
#!/bin/bash
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Make script gives up on any error
set -e
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo checkinstall
View portablesed.sh
case $(sed --help 2>&1) in
*GNU*) sed_i () { sed -i "$@"; };;
*) sed_i () { sed -i '' "$@"; };;
esac
sed_i -e '' "$file"
# thats it mofuer!
# https://unix.stackexchange.com/a/92907/40896
View python_getfile.py
from urllib2 import urlopen, URLError, HTTPError
try:
f = urlopen(url)
with open(savepath, "wb") as local_file:
w.prnt('', 'Writing to: {0}'.format(savepath))
local_file.write(f.read())
return True
except (HTTPError, URLError), e:
w.prnt('', 'Failed downloading: {0}'.format(e))
return False
View gist:812a4200faefbbf7881dc398859bf300
]0;dza@adrafinil: ~dza@adrafinil:~$
[5@(reverse-i-search)`':v': vim -u .vimrccursor .ssh/config --noplugin
[1@i[1@m
]0;dza@adrafinil: ~dza@adrafinil:~$
]0;dza@adrafinil: ~dza@adrafinil:~$ 
[?2004h[?1049h[?1h=[?2004h[?12h[?12l[?25l".ssh/config" 57L, 887C▽ [>c]11;?Host irc
HostName #censored
Port #censored
User #censored
View gist:b7bef564d9f17821fcb85bb44f19c3bf
]0;dza@adrafinil: ~dza@adrafinil:~$ vim -u .vimrccursor --noplugin .ssh/config
[?2004h[?1049h[?1h=[?2004h[?12h[?12l[?25l".ssh/config" 57L, 887C▽ [>c]11;?P$q q\Host irc
HostName #censored
Port #censored
User #censored
Host weerc
HostName #censored
Port #censored
User #censored
View pf.conf.sh
# /etc/pf.conf
ext_if = "vtnet0"
ext_addr = $ext_if:0
int_if = "lo1"
jail_net = $int_if:network
jail_irc = "10.0.0.1"
jail_weerc = "10.0.0.2"
# ircd, ircs-u is from /etc/services 6667 6697 respectively
#irc_ports = "{ ircd, ircs-u }"
View vim_from_source.sh
#!/usr/bin/env bash
git pull
version=$(git describe --abbrev=0 --tags)
echo $version
make clean distclean
#./configure --with-features=normal --disable-darwin --disable-smack --disable-selinux --disable-xsmp --disable-xsmp-interact --disable-netbeans --disable-gtktest --disable-icon-cache-update --disable-desktop-database-update --disable-largefile --disable-acl --disable-gpm --disable-sysmouse --disable-nls --enable-multibyte --enable-rubyinterp=yes --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/ --enable-perlinterp=yes --enable-luainterp=yes --enable-cscope --prefix=/usr/local
./configure --with-features=huge --disable-darwin --disable-xsmp --disable-xsmp-interact --disable-netbeans --disable-gtktest --disable-icon-cache-update --disable-desktop-database-update --disable-acl --disable-gpm --disable-sysmouse --disable-nls --enable-multibyte --enable-rubyinterp=yes --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-
View gist:8207400da022faf17f0fd4e627979257
## at server
# sudo nc -l 80
# authorize via web login (visit with browser)
https://accounts.spotify.com/authorize?client_id=7b549c1f2da4469cb95361e3c146ce06&response_type=code&redirect_uri=http://w.iw.tc/spotify_callback
# receives code in nc
# GET /spotify_callback?code=AQCVusSf7OHhUt_jIXZodG4nQFZ8iBuX999mYli0xoNzWuqVuKhHVNA7sLSCwc9w3NUdk6GKnZeELbcSGOU1Wk_lkkWNVFBcgoDAxlyxdi2FpaIMjDM7s1kyjecu-orqv3g37c92fqcDj6wssKxz7VZSKLwhxwZfsYK3hAyJeCAgBM3oxZoACqYGyYeTO70_MfLXrxw HTTP/1.1
# get access_token
You can’t perform that action at this time.