This file contains 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 | |
version=1.0.1 | |
versionDate="2014-02-14" | |
function showHelp() { | |
echo "watchfile - monitor file(s)/command and perform action when changed | |
Possible ways of usage | |
---------------------------------------- |
This file contains 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 | |
# $1: PID | |
# Returns true if a process exists with pid=PID | |
function isProcessAlive { | |
if [ `ps -p $1 | wc -l` -gt 1 ] ; then | |
return 0; | |
else | |
return 1; | |
fi |
This file contains 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 | |
[[ ! "$1" == "-" && ! "$1" == "+" ]] && echo "Invalid sign paramter [-|+]" && exit; | |
[[ "$1" == "-" ]] && suff="neg"; | |
[[ "$1" == "+" ]] && suff="pos"; | |
cntfile='cntfile_'$suff | |
[[ ! -e $cntfile ]] && echo '0' > $cntfile; | |
file='values_'$suff |
This file contains 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 | |
if [ ! $# -eq 2 ] ; then | |
echo "Usage: ./recordscreen delay outputfolder" | |
exit | |
fi | |
if [ ! -d $outputFolder ] ; then | |
echo "Output folder does not exist" | |
exit |
This file contains 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
#include <memory> | |
#include <stack> | |
#include <stdexcept> | |
template <class T, class D = std::default_delete<T>> | |
class SmartObjectPool | |
{ | |
private: | |
struct ReturnToPool_Deleter { | |
explicit ReturnToPool_Deleter(std::weak_ptr<SmartObjectPool<T, D>* > pool) |
This file contains 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 | |
#$1: Path to child directory | |
git_root_recurse_parent() { | |
# Check if cwd is a git root directory | |
if [ -d .git/objects -a -d .git/refs -a -f .git/HEAD ] ; then | |
pwd | |
return 0 | |
fi |
This file contains 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 | |
if [ $# -eq 1 ] ; then | |
path=$1 | |
else | |
clipboard=$(xclip -selection clipboard -o) | |
if [ $(<<<$clipboard grep -P "^http") ] ; then | |
path=$clipboard | |
else | |
if [ -t 1 ] ; then |
This file contains 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 | |
delay=0.2 | |
title='default' | |
count=0 | |
loop=1 #0 for infinite loop | |
# Set if you want to skip mouse selection | |
if [[ $# -eq 6 ]] | |
then |
This file contains 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 | |
function showHelp { | |
version=0.0.1 | |
versionDate="2014-07-07" | |
echo "$0 - tic/toc timer pair | |
Usage: $0 [id] Stores initial time (w/optional id marker) | |
$0 [-u|--unique] Creates and returns unique id |
This file contains 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 | |
# Use this with a global hotkey to the following: gksudo [FULLPATH]/enterpass.sh | |
if [[ $EUID -ne 0 ]] ; then | |
notify-send "This script must be run as root" | |
exit | |
fi | |
if ! command -v userpass > /dev/null ; then |
NewerOlder