This file contains hidden or 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
import string, random | |
pool = string.ascii_letters + string.digits | |
print(''.join(random.choices(pool, k=16))) |
This file contains hidden or 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 | |
# Doesn't seem to handle filenames with spaces correctly | |
find . -iname "*.png" -type f -exec identify -format '%w %h %i\n' '{}' \; | | |
awk '($1==1080 && $2==1920) || ($1==1920 && $2==1080) || ($1==648 && $2==1108) { print $3 }' | xargs cp -t filter |
This file contains hidden or 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
" Fix text/data segment dump of MARS 4.5 | |
" Convert tabs to 8 spaces | |
set tabstop=8 | |
retab | |
" Justify line number col: select visual block then indent | |
<C-v> > |
This file contains hidden or 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
# Put in ~/.local/share/applications to override .desktop file in /usr/share/applications | |
[Desktop Entry] | |
Version=1.0 | |
Name=Google Chrome | |
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings. | |
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413. | |
GenericName=Web Browser | |
GenericName[ar]=متصفح الشبكة | |
GenericName[bg]=Уеб браузър | |
GenericName[ca]=Navegador web |
This file contains hidden or 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 | |
# Executing grep every time is a little slow, but bash regex doesn't support | |
# lazy evaluation and it's not worth rewriting... | |
IFS='' # Preserve whitespace for read | |
while read p; do # Read /boot/grub/grub.cfg line by line | |
LINE_REGEX=`echo $p | grep -Po "menuentry ['\"]\K.+?(?=['\"])"` | |
if [ "$LINE_REGEX" ]; then | |
# Submenu lines begin with a tab, so lazy method is to check for that |
This file contains hidden or 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
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr |
This file contains hidden or 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 -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will "exit 0" on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution | |
# bits. |
This file contains hidden or 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
echo "$1" | tr '\!-~' 'P-~\!-O' |
This file contains hidden or 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 | |
# See full range of terminal colors | |
for C in {0..255}; do | |
tput setab $C | |
printf "%4d" "$C" | |
if ((C%16 == 15)); then echo; fi | |
done | |
tput sgr0 |
This file contains hidden or 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
yt-dlp -x --audio-format mp3 $1 |
OlderNewer