View Solaar_forced_kickass.sh
#!/bin/bash
SOLAAR_HOME=/home/fstpk/.bin/Solaar/bin
# check keyboard state
# 0 - kbd is offline; 1 - kbd is online
function check_state {
${SOLAAR_HOME}/solaar show 2 | grep offline > /dev/null
RESULT=`echo $?`
}
View Package version from git tag
#!/bin/env bash
function git_version(){
local ws=$(test -n "$1" && echo "--git-dir=${1}/.git")
# Get latest tag for current branch and number of ahead commits
local tag=$(git $ws describe --tags --abbrev=0)
[[ $tag =~ ^v*[0-9]+\.[0-9]+\.[0-9]+$ ]] || {
echo "Error: Git tag is not set or has invalid format: $tag" >&2
return 1
}
View dockerdns.sh
#!/usr/bin/env bash
# Dnsmasq updater
# Version 1.1
set -e
temp=$( mktemp --suffix=.docker )
if [[ -f /etc/dnsmasq.d/docker_hosts.new ]]; then
View primary_numbers
#! /usr/bin/env python
from math import sqrt
from time import time
def pg():
lim=raw_input("\nGenerate prime numbers up to what number? : ")
sqrtlim=sqrt(float(lim))
pp=2
ep=[pp]
ss=[pp]
pp+=1
View local_forwarding
iptables -t nat -A PREROUTING -p tcp -d $ext_ip --dport $ext_port -j DNAT --to-destination $local_ip:port
iptables -A FORWARD -i ppp0 -d $local_ip -p tcp --dport $port -j ACCEPT
iptables -A FORWARD -o ppp0 -s $ext_ip -p tcp --sport $ext_port -j ACCEPT
View rmount.sh
#!/bin/bash
user=
host=
mount_dir=
target=$1
destination=$2
if [ -z "$target" -o -z "$destination" ]
then
echo -e "\nUsage:\n'rmount /remote/dir/ \$destination' == sshfs $user@$host:/remote/dir/ $mount_dir\$destination\n"
View gifcreate
#!/bin/sh
help () {
log "Usage: `basename $0` [-h] [-n] [-a] [-u] [-s hh:mm:ss] [-d ss] [-w px] [-f n] [-S n] [-b n] <filename> [result.gif]
-h show this help
-n turn off subtitles
-a don't open directory with frames in filemanager
-u update this script from gist. Create .gifupd file in the script's directory to automatically check for updates once per day or put the number of seconds in the file to check with that period.
-s start time in seconds or as hours:minutes:seconds, default: 0
View kannel_checker.sh
#!/bin/bash
#Created by fastpoke at 08.02.2013
#Other thanks to +Rei Ayanami
#Code licensed by GPL v.3
#################################################################################
# #
# IMPORTANT INFORMATION #
# #