Skip to content

Instantly share code, notes, and snippets.

@Frankz
Frankz / .tmux.conf
Created February 12, 2018 07:40 — forked from Neo-Oli/.tmux.conf
Tmux settings for termux
set-option -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# Resize panes with arrow keys because alt-arrow keys doesn't work
bind-key -r Up resize-pane -U
bind-key -r Down resize-pane -D
bind-key -r Left resize-pane -L
bind-key -r Right resize-pane -R
@Frankz
Frankz / backup_restore.bash
Created April 13, 2018 21:01 — forked from mark-rushakoff/backup_restore.bash
Backup and restore influxdb inside Docker
#!/bin/bash
set -e
# Default working directory to current directory, but allow override via WORKDIR environment variable.
WORKDIR=${WORKDIR:-$PWD}
NOW="$(date +%s)"
INFLUXDIR="$WORKDIR/influxdb-$NOW"
BACKUPDIR="$WORKDIR/backup-$NOW"
@Frankz
Frankz / README.MD
Created May 3, 2018 14:45 — forked from RichardBronosky/README.MD
Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]).

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable

Examples

@Frankz
Frankz / typeofvar.sh
Created August 14, 2018 12:02 — forked from CMCDragonkai/typeofvar.sh
Bash: Get the type of a variable
#!/usr/bin/env bash
typeofvar () {
local type_signature=$(declare -p "$1" 2>/dev/null)
if [[ "$type_signature" =~ "declare --" ]]; then
printf "string"
elif [[ "$type_signature" =~ "declare -a" ]]; then
printf "array"
@Frankz
Frankz / pastebin.sh
Created August 16, 2018 18:31 — forked from ktmud/pastebin.sh
Pastebin Bash Script.
#!/bin/bash
# Paste at Pastebin.com using command line (browsers are slow, right?)
# coder : Anil Dewani
# date : Novemeber 7, 2010
#help function
howto()
{
echo "\
Pastebin.com Bash Script \
@Frankz
Frankz / howto-build-icinga2-debian-ubuntu-packages.md
Last active October 21, 2018 03:00 — forked from andrenarchy/howto.md
Build icinga2 and icinga-web Debian/Ubuntu packages for non-{i386,amd64} architectures

Build icinga2 and icinga-web Debian/Ubuntu packages for non-{i386,amd64} architectures

Why?

The icinga PPA only provides packages for i386 and amd64. If you're running an ARM-powered device such as the Raspberry Pi or the ODROID U3 (which I use), you have to build the packages yourself. However, compiling the packages is very easy thanks to Debian's excellent build tools and the work of the icinga package maintainer. This howto uses pbuilder which builds in a clean chroot so your original system is not polluted with build packages.

@Frankz
Frankz / RestApiTest.ps1
Created November 12, 2018 19:51 — forked from bryan-c-oconnell/RestApiTest.ps1
bryanoconnell.blogspot.com - Test your RESTful API using PowerShell
# |Info|
# Written by Bryan O'Connell, November 2014
# Purpose: Sample of a functional test script for a RESTful API.
#
# Thanks to contributors on the 'jsonplaceholder' project for making a publicly
# accesible and generic REST API (which is used in the examples below).
# - http://jsonplaceholder.typicode.com
# - https://github.com/typicode/jsonplaceholder
#
# |Info|
@Frankz
Frankz / winrun.sh
Created July 13, 2019 01:14 — forked from valin4tor/winrun.sh
Workaround for microsoft/WSL#1614 (place in /usr/bin/winrun)
#!/bin/bash
command=$1
args=${@:2}
winrun_pid=$$
pidfile="/tmp/winrun-pid-$(date +%s)"
if [[ $args != '' ]]; then
argumentlist="-ArgumentList \"$args\""
fi
@Frankz
Frankz / web-servers.md
Created July 23, 2019 23:24 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Frankz
Frankz / scp-speed-test.sh
Created July 25, 2019 02:17 — forked from mohanraj-r/scp-speed-test.sh
[speed test] Test ssh connection speed
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
# http://www.alecjacobson.com/weblog/?p=635
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in kBs]