Skip to content

Instantly share code, notes, and snippets.

View thomsh's full-sized avatar
💭
🥝

Thomas thomsh

💭
🥝
View GitHub Profile
@thomsh
thomsh / .screenrc
Created January 21, 2015 13:56
.screenrc
# THIS IS THE PRETTY BIT
#change the hardstatus settings to give an window list at the bottom of the
##screen, with the time and date and with the current window highlighted
hardstatus alwayslastline
#hardstatus string '%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
@thomsh
thomsh / bashrc_hubic
Created March 14, 2016 17:18
split file hubic
function hubic_splitbigfile_in_cwd (){
set -x
for f in $(find . -type f -ls |awk '{ if ($7 >4194304000) print $11}')
do
split -d --bytes=4000M "${f}" "${f}."
rm -f -- "${f}"
done
set +x
}
@thomsh
thomsh / cryptop.txt
Last active July 4, 2024 11:36
cryptop
sd:
1)wgt:(/|/sdbackup/)sdbackup.bin\.tar\.gz/
2)echo -n "ta.."|openssl whirlpool -binary |base64 -w 0 #=^Rl/
2.1) (optional)openssl aes-256-cbc -d -md md5 -in i -out o
3) --key-file a --offset=0 --readonly --cipher aes-xts-plain --key-size=512 --type plain open devX name
---------------------------------------------
sh:
1) l=s....nres..e ; p=995; fpr=(JN5TpD/hwppRotTpsK...|46:08:e6:33:87:....
2) pw=$(echo -n "ta...j..b.....(.)"|sha1) #=^4e|^cd
----
@thomsh
thomsh / install-firefox-release.sh
Last active May 16, 2023 19:23
Install latest stable binary version of firefox for desktop linux distro (tested Debian 11, proably Ubuntu too)
#!/usr/bin/env bash
# Purpose: Download and install latest stable firefox for any Linux distribution
# gpg --receive-keys 0x4360FE2109C49763186F8E21EBE41E90F6F12F6D
# Update 2021-06-03: key change, new key is signed with old 0x14F26682D0916CDD81E37B6D61B7B526D98F0353
# https://blog.mozilla.org/security/2021/06/02/updating-gpg-key-for-signing-firefox-releases/
# GPG SETTINGS
RELEASE_KEY_FINGERPRINT="0xADD7079479700DCADFDD5337E36D3B13F3D93274"
MOZILLA_KEY_SERVER="gpg.mozilla.org"
GNUPGHOME="/var/cache/gnupg_download_firefox_release"
@thomsh
thomsh / zram2swap.sh
Last active July 19, 2018 12:44
Setup zram as swap quick and dirty
#!/usr/bin/env bash
zramctl=$(command -v zramctl)
if [[ -z "$zramctl" ]];then
echo "Command zramctl not found" 1>&2
exit 2
fi
if swapon -s |grep '^/dev/zram' > /dev/null ; then
echo "zram already setup as swap"
exit 0
@thomsh
thomsh / lastpass-update-ca-20180516.patch
Created May 23, 2018 16:32
lastpass change their CA patch pins.h (GlobalSign R1/R3 pins)
Description: lastpass ca change GlobalSign R1/R3 pins
https://github.com/lastpass/lastpass-cli/commit/b888411b042df9414d1d78d99332b672e65c4eb9
https://github.com/lastpass/lastpass-cli/issues/409
.
lastpass-cli (1.0.0-1.2) unstable; urgency=medium
.
* Non-maintainer upload.
---
The information above should follow the Patch Tagging Guidelines, please
@thomsh
thomsh / gpg.conf
Last active August 9, 2018 12:41
.gnupg/gpg.conf
# uncomment default key if needed
# default-key 0xCHANGEME
charset utf-8
keyserver hkp://keys.gnupg.net
# privacy concern
no-emit-version
no-comments
export-options export-minimal
@thomsh
thomsh / xrandr_add_mode_asus_PG278Q.sh
Created December 10, 2018 19:35
Set correct resolution for ASUS ROG PG278Q on debian stretch
#!/bin/bash
set -ex
# Set correct resolution for ASUS ROG PG278Q on debian stretch
# Problem : "gtf 2560 1440 60" didn't return correct value for this screen
# solution found : https://askubuntu.com/questions/621643/can-not-set-proper-resolution-on-this-one-monitor
# ( with https://www.entechtaiwan.com/util/moninfo.shtm )
#add new mode for this "unknown display"
xrandr --newmode "2560x1440_60.00" 241,500 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
# change DP-1 per appropriate display `xrandr -q` to list
@thomsh
thomsh / nginx-vod-module-install-debian-stretch.sh
Last active September 28, 2019 02:39
Rebuild nginx on Debian Stretch with Kaltura nginx-vod-module
#!/bin/bash
set -euxo pipefail
# Install latest Nginx from backports on Debian Stretch
# with nginx-vod-module from https://github.com/kaltura/nginx-vod-module
# This script/doc will rebuild the deb package
# Requirement : run on Debian Stretch with backports repository enabled
if ! egrep '^deb .+ stretch-backports' -- /etc/apt/sources.list /etc/apt/sources.list.d/*.list ; then
echo 'deb http://deb.debian.org/debian/ stretch-backports main contrib non-free' |tee /etc/apt/sources.list.d/bpo.list
fi
@thomsh
thomsh / google-authenticator-gen-qrcode.sh
Last active January 30, 2020 04:39
How to generate QR code for Google Authenticator
#!/usr/bin/env bash
NAME="$1"
SECRET="$2"
exec qrencode -d 300 -s 10 -t ansiutf8 "otpauth://totp/${NAME}?secret=${SECRET}"
#PNG #exec qrencode -o /dev/shm/ga.png -d 300 -s 10 "otpauth://totp/${NAME}?secret=${SECRET}"