Skip to content

Instantly share code, notes, and snippets.

View smlb's full-sized avatar

Simone Lombardi smlb

View GitHub Profile
@smlb
smlb / autoexec.cfg
Last active February 28, 2019 11:28
// Smlb Autoexec
// Buy Binds
bind "del" "buy ak47; buy m4a1;"
bind "pgdn" "buy awp;"
bind "kp_pgup" "buy deagle;"
bind "End" " buy vesthelm; buy vest;"
bind "ins" "buy p250;"
bind "rightarrow" "buy hegrenade"
bind "leftarrow" "buy molotov;buy incgrenade"
#!/bin/bash
# A simple script that list all the AUR packages
# Clone, rebuild and add them to a local repository
# It's very very rude.
find=$(find . -maxdepth 1 -type d | cut -c 3-)
repo="/home/$(whoami)/repo"
[[ -d $repo ]] || mkdir -p $repo
cd $repo
FROM alpine:latest
MAINTAINER smlb
RUN apk update && \
apk add --no-cache curl-dev gcc musl-dev make
RUN mkdir /c3p0
ADD src/ /c3p0
WORKDIR /c3p0
RUN make && \
./bin/c-3po irc.freenode.net 6667 test_bot12345 \#\#sysyphus:porcodio
if [[ $(xrandr | awk '/HDMI-0/ {print $2}') == "connected" ]]; then
exec i3 -c ~/.config/i3/dual
else
exec i3
fi
i3status | (read line && echo $line && read line && echo $line && while :
do
read line
vars=`echo -e "$([[ -z $(mpc current) ]] && echo -e "" || echo -e " $(mpc current)|")$(free -m | awk '/Mem/ {print $3}')Mb"`
text="[{ \"full_text\": \"${vars}\" },"
echo "${line/[/$text}" || exit 1
done)
#!/bin/bash
active_connection=`awk '/\*/ {print $2}' <(netctl list)`
red='\e[0;31m'
noc='\e[0m'
_get_connection() {
echo -e "1)$red devnull$noc\n2)$red eduroam$noc\nSelect a connection [o=1, t=2, q=quit]: "
read otq
case $otq in
@smlb
smlb / touchpad.sh
Created July 14, 2017 19:24
nobody cares
#!/usr/bin/env bash
# toggle the touchpad
state=$(awk '/TouchpadOff/ { print $3 }' <(synclient -l))
case "$state" in
0) synclient touchpadoff=1
unclutter -noevents
;;
1) synclient touchpadoff=0
@smlb
smlb / tmux.sh
Created July 13, 2017 15:38
tmuxbar
#!/bin/bash
RAM() {
echo -e "\xe2\x88\x9e $(free -h | awk '/Mem:/{print $3}')"
}
BATT() {
echo -e "\xe2\x99\xa5 $(acpi | awk {'print $4'} | sed 's/,//' || echo off)"
}
@smlb
smlb / porco.vim
Created July 6, 2017 14:49
terminal function gsora.xyz
autocmd! BufWritePost * Neomake
" Make ctrl-h/j/k/l move between windows and auto-insert in terminals
func! s:mapMoveToWindowInDirection(direction)
func! s:maybeInsertMode(direction)
stopinsert
execute "wincmd" a:direction
if &buftype == 'terminal'
startinsert!
@smlb
smlb / full_list.txt
Last active June 1, 2017 18:31
List that I use for Pihole: for url in `cat lists.txt`; do echo $url; curl -L $url » full_list.txt; done
event-img.qwapi.com
adserver-live.yoc.mobi
admax.nexage.com
mm.admob.com
iphone-services.apple.com
iphonesubmissions.apple.com
ads2.greystripe.com
adsx.greystripe.com
c.greystripe.com
a.medialytics.com