Skip to content

Instantly share code, notes, and snippets.

View uriel1998's full-sized avatar

Steven Saus uriel1998

View GitHub Profile
@uriel1998
uriel1998 / ape2id3.py
Last active August 14, 2016 12:08
A python script to convert APEv2 ReplayGain tags, such as those written by mp3gain and foobar2000, to ID3v2 ReplayGain tags which MPD can read. ape2id3.py does not support recursing through subdirectories. Requires Mutagen. In Ubuntu run "sudo apt-get install python-mutagen". From http://mpd.wikia.com/wiki/Hack:ape2id3.py , no attribution given.
#! /usr/bin/env python
import sys
from optparse import OptionParser
import mutagen
from mutagen.apev2 import APEv2
from mutagen.id3 import ID3, TXXX
def convert_gain(gain):
if gain[-3:] == " dB":
gain = gain[:-3]
@uriel1998
uriel1998 / picframe.sh
Created August 24, 2016 22:10
Pictureframe With Conky
#!/bin/bash
# Exactly as found from https://ubuntuforums.org/showthread.php?t=1609575
# Except I added in where if you chose a directory, it'll pic a random
# picture from it.
## Picture frame via conky
## Author: Anjishnu Sarkar
## TODO:
@uriel1998
uriel1998 / keybase.md
Created September 7, 2016 14:14
keybase.io verification

Keybase proof

I hereby claim:

  • I am uriel1998 on github.
  • I am stevensaus (https://keybase.io/stevensaus) on keybase.
  • I have a public key whose fingerprint is 9211 C1BC 8287 EFF0 63B4 E330 E54D 0B93 DD2F 731F

To claim this, I am signing this object:

@uriel1998
uriel1998 / touchpad.sh
Created January 7, 2017 18:41
Bash script to determine xinput number of touchpad (which changes!) and disable/enable
#!/bin/bash
pad_name=$(xinput list --name-only | grep TouchPad)
id=$(xinput list --id-only "$pad_name")
case "$1" in
[Oo][Nn]*) xinput set-prop $id "Device Enabled" 1
;;
[Oo][Ff]*) xinput set-prop $id "Device Enabled" 0
;;
@uriel1998
uriel1998 / main file
Created March 21, 2015 23:40
infringer
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://ogp.me/ns/fb#" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta property="og:url" content="/libri-1437-462-szanse_i_perspektywy_polskiej_gospodarki_w_unii_europejskiej/" />
<meta property="og:description" content="Szanse I Perspektywy Polskiej Gospodarki W Unii Europejskiej. Author: Eulalia Skawinska. Pages: 1203. Format: pdf, epub, fb2, txt" >
<meta name="keywords" content="Szanse I Perspektywy Polskiej Gospodarki W Unii Europejskiej by Eulalia Skawinska,Szanse I Perspektywy Polskiej Gospodarki W Unii Europejskiej"/>
<meta property="og:type" content="article" />
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
@uriel1998
uriel1998 / usera_dropbox.sh
Created May 3, 2018 13:03
Script to run dropbox for multiple users on a headless server
#!/bin/bash
unset DISPLAY
HOME="/home/user/accountA"
/home/user/accountA/.dropbox-dist/dropboxd
@uriel1998
uriel1998 / plaintext-convert.sh
Last active October 15, 2020 04:17 — forked from sbrl/plaintext-convert.sh
Converter for pirate/bookmark-archiver that converts a plain-text list of urls into something it can understand.
#!/bin/bash
#set -o errexit
#set -o nounset
##############
# This program converts a plain-text list of urls to the
# bookmark-archiver HTML format.
#
# Requirements: curl, xidel
# Usage:
@uriel1998
uriel1998 / subdir_copy.sh
Created August 14, 2016 15:09
Small shell script to copy each file in a directory into a subdirectory named the same as the filename (but not extension!) and then move the file into it.
#!/bin/bash
dir=$(echo "$PWD")
for f in *
do
if [ -f "$f" ];then
# this is redundant due to how I'm searching, but why not?
filename=$(basename "$f")
extension="${filename##*.}"
@uriel1998
uriel1998 / toodt.sh
Created April 25, 2014 01:50
A quick shell script to use pandoc to convert markdown to libreoffice and open it.
#!/bin/bash
# usage:
if [ -f "$1" ]; then
file=$(basename "$1")
filename=${file%.*}
pandoc "$1" -V geometry:margin=1in -s -o "$filename".odt
lowriter "$filename".odt
fi
@uriel1998
uriel1998 / newwall.sh
Created February 13, 2014 22:13
Background manager, setter, tiler, mirrorer, etc - using mostly feh and imagemagick
#!/bin/bash
# Quite a bit of inspiration from https://gist.github.com/brycied00d/1190483
# I have a lot of backgrounds, and a laptop. I use xinarama, so my DISPLAY is always 0:0
# But I wanted to have one randomizer that used feh (2.9.3 is the version I have) but actually showed resolution-appropriate images.
# I also wanted to be able to select the color - "tiled", "orange", "blue", "black", "simple", "wide" (hooray for symlinks) at times.
# Uses xrandr to see if there is an HDMI monitor attached (which in my use cases always means I am rocking two monitors
#sets background