Convenient CLI and GUI for adjusting the brightness on my Ubuntu installation in my Thinkpad T440
These are convenience scripts for encrypting/decrypting files with a password, salt, and an algorithm of your choice.
After performing the encryption/decryption, the script will ask whether you want to move the source files to the trash (using trash-cli
). This option defaults to No.
These scripts will not overwrite any existing files but rather will exit with an error code if an existing file blocks their operation.
The algorithm defaults to aes-256-cbc, but you can set an environment variable ALGORITHM
to override it.
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
[Desktop Entry] | |
Name=My Timer | |
Exec=/home/markham/scripts/timer.py | |
Icon=/usr/share/icons/cute.jpg | |
Type=Application | |
Terminal=false | |
StartupNotify=true | |
Categories=GTK;GNOME;Utility; |
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
#!/usr/bin/env python | |
from gi.repository import Unity, GObject, Dbusmenu | |
import time, sys, re, os, pipes, StringIO | |
DESKTOP_FILE_NAME = 'my-timer.desktop' | |
PIPEFILE_NAME = '/tmp/my-timer-pipefile' | |
# Assumes your desktop file is 'my-timer.desktop' | |
launcher = Unity.LauncherEntry.get_for_desktop_id(DESKTOP_FILE_NAME) | |
launcher.set_property('progress_visible', True) |
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 | |
usage () { | |
echo "Usage:" | |
echo -e "\t$0 [options] [dir] [rails env]" | |
echo "Options:" | |
echo -e "\t-e rails_env" | |
echo -e "\t-f yaml_file" | |
echo "Inclusion of 'file' option overrides 'dir' arg" | |
echo "@arg dir defaults to pwd" |
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 | |
# Examines id3 tages of files in given directory and moves them | |
# to $TOPDIR, renaming path and file to match "artist/album/track - title.ext" | |
# - if album is absent: "artist/track - title.ext" | |
# - if track is absent: "artist/album/title.ext" | |
# - if title is absent: "artist/album/filename" | |
TOPDIR="$HOME/Music" |
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
javascript: | |
TIME_REGEX = /^(\d+):(\d+) (\w+)/; | |
function show (targetHours) { | |
var clockoutMatch = /(\d{2}):(\d{2}):(\d{2}){0,1}/.exec(getClockoutTime(targetHours).toString()); | |
var outputHours = parseInt(clockoutMatch[1]); | |
var outputMeridian = (outputHours >= 12) ? 'pm' : 'am'; | |
if (outputHours > 12) outputHours = outputHours % 12; | |
var clockoutString = "Clock out: "+outputHours+':'+clockoutMatch[2]+' '+outputMeridian; | |
if (clockoutMatch[3]) clockoutString += ' & '+clockoutMatch[3]+' sec'; |
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 | |
pattern=$1 | |
mtime=$2 | |
grep_args="-q -i" | |
[[ ! -z "$3" ]] && grep_args=$3 | |
export pattern | |
count=0 | |
export count |
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 OFF | |
REM Set vars | |
SET projdir=%ProgramFiles%\DataRaptorDialer | |
SET batfile=%projdir%\DataRaptorDialer.BAT | |
SET regfile=%projdir%\DataRaptorDialer.REG | |
IF NOT EXIST "%projdir%" ( MKDIR "%projdir%" ) | |
REM Make .BAT file | |
( |
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 | |
# Run this script before deploying to make a text file containing all | |
# schema_migrations. | |
# | |
# After deploying, if a rollback is required, run this script again | |
# with an argument of 'back' to cherry-pick new migrations out of | |
# schema migrations (ones that weren't in the pre-deploy log of | |
# schema_migrations) and reverse them with rake db:migrate:down VERSION=X. |