This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ ! -z "$1" ] || exit | |
NAME=$1 ; cd $NAME | |
DATESTAMP=$(date +"%Y%m%d") | |
VERSION=$(git describe master --tags --match='v*' | sed 's/^v//' | cut -d- -f1) | |
COMMIT=$(git rev-parse --short=5 HEAD) | |
git archive master --format=tar.gz --prefix=$NAME-$VERSION~git$DATESTAMP.$COMMIT/ -o ../$NAME-$VERSION~git$DATESTAMP.$COMMIT.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dd if=/dev/urandom of=/root/keyfile bs=1024 count=4 | |
sudo chmod 0400 /root/keyfile | |
sudo cryptsetup luksAddKey /dev/sdX /root/keyfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt install -y gcc-4.9 g++-4.9 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=AutoSSH service for a reverse tunnel from some.example.com to localhost | |
After=network.target | |
After=networking.service | |
[Service] | |
Environment=AUTOSSH_FIRST_POLL=30 | |
Environment=AUTOSSH_GATETIME=0 | |
Environment=AUTOSSH_POLL=60 | |
Environment=USERNAME=user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dget -ux http://ru.archive.ubuntu.com/ubuntu/pool/main/x/xorg-server/xorg-server_1.19.5-0ubuntu2.dsc | |
wget https://bugs.freedesktop.org/attachment.cgi?id=129861 -O xkb-switch-on-release.patch | |
cd cd xorg-server-1.19.3 | |
quilt import ../xkb-switch-on-release.patch | |
dch -l ppa~artful -D artful 'Add xkb-switch-on-release.patch' | |
debuild -S -sd -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put into /lib/systemd/system-sleep/suspend-modules | |
# chmod a+x /lib/systemd/system-sleep/suspend-modules | |
# Create /etc/suspend-modules.conf | |
# with one module per line | |
# credits to: | |
# https://bbs.archlinux.org/viewtopic.php?pid=1540125#p1540125 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DEADBEEF=$(which deadbeef) | |
ARTIST_NAME=$($DEADBEEF --nowplaying-tf "%artist%") | |
TRACK_TITLE=$($DEADBEEF --nowplaying-tf "%title%") | |
printf "\033c" | |
ARTIST=$(echo "$ARTIST_NAME" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
import glob | |
from mutagen.mp3 import MP3 | |
from mutagen.easyid3 import EasyID3 | |
# | |
# MP3 playlist generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# resize jpeg | |
mogrify -format jpg -strip -interlace plane -sampling-factor 4:2:0 -define jpeg:dct-method=float -density 300x300 -resize 50% -quality 85 -path /tmp *.jpg | |
convert -format jpg -strip -interlace plane -sampling-factor 4:2:0 -define jpeg:dct-method=float -density 300x300 -resize 50% -quality 85 file.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Compton X11 compositor | |
After=graphical.target | |
[Service] | |
Type=forking | |
Restart=always | |
RestartSec=10 | |
ExecStart=/usr/bin/compton -b | |
ExecReload=/bin/kill -SIGUSR1 $MAINPID |
OlderNewer