Skip to content

Instantly share code, notes, and snippets.

View qub1750ul's full-sized avatar
💭
I may be slow to respond.

Magical Quantum Compute qub1750ul

💭
I may be slow to respond.
View GitHub Profile
@qub1750ul
qub1750ul / sxiv-cycle.sh
Created November 24, 2017 20:47
wrapper script for sxiv - browse through images in directory after opening a single file
#!/bin/sh
# Compatible with ranger 1.6.0 through 1.7.*
#
# This script searches image files in a directory, opens them all with sxiv and
# sets the first argument to the first image displayed by sxiv.
#
# This is supposed to be used in rifle.conf as a workaround for the fact that
# sxiv takes no file name arguments for the first image, just the number. Copy
# this file somewhere into your $PATH and add this at the top of rifle.conf:
#
@qub1750ul
qub1750ul / letitsnow.sh
Last active January 25, 2018 18:36
Let It Snow In Your Terminal
#!/bin/bash
# Single cases are from
# http://climagic.org/coolstuff/let-it-snow.html
#
# Multi-mode script
# made by qub1750ul
fallSpeed=0.1
@qub1750ul
qub1750ul / garbageCollector.sh
Created June 15, 2018 15:16
A garbage collector for pacman
#!/usr/bin/sh
# Create a database directory that
# ignore pacman database lock without forcefully unlock it
pacmanDb=/var/lib/pacman
noLockDb=/tmp/pacman-garbageCollector
mkdir -p $noLockDb/local $noLockDb/sync
@qub1750ul
qub1750ul / pacman-fix-tip.md
Last active July 2, 2018 15:52
How to solve "duplicated database entries" with pacman
  • Ensure that no .pacnew files exists in the system
  • Get the list of duplicated package entries, store it in a file named duplicateNames.txt
  • Execute this script as root
extraEntries="`\
	for name in $( cat duplicateNames.txt ) ; do
		ls $localDb | grep $name | sort | sed 1d
	done
`"
#!/bin/bash
if [ -z "$XDG_RUNTIME_DIR" ] ; then declare -r XDG_RUNTIME_DIR="/tmp" ; fi
set -o errexit
set -o nounset
set -o pipefail
declare -ar servicePortList=( 2001 2002 2010 2011 2012 2013 2014 )
declare -ri sshPort=2000