Skip to content

Instantly share code, notes, and snippets.

@Frankz
Frankz / Free O'Reilly Books.md
Created September 3, 2019 19:07 — forked from ellerbrock/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@Frankz
Frankz / javainstall.sh
Created August 3, 2019 12:59 — forked from Sawaba/javainstall.sh
Java JDK 11 install script for Windows Subsystem for Linux (WSL)
#!/bin/bash
# This script adapted from an older post on StackOverflow by user fieldju
# https://stackoverflow.com/questions/36478741/installing-oracle-jdk-on-windows-subsystem-for-linux
# The script was for JDK 8.
# Due to major changes with JDK 11 (no JRE, no Derby, Unlimited Strength included), it was necessary to update the entire script.
set -ex
# UPDATE THESE URLs (this one updated as of 2019-03-06)
export JDK_URL=http://download.oracle.com/otn-pub/java/jdk/11.0.2+9/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_linux-x64_bin.tar.gz
@Frankz
Frankz / ssh-cipher-benchmark.sh
Created July 25, 2019 09:19 — forked from dlenski/ssh-cipher-benchmark.sh
Check speed of ssh cipher(s) on your system
#!/bin/bash
# Based on: http://www.systutorials.com/5450/improving-sshscp-performance-by-choosing-ciphers/#comment-28725
#
# You should set up PublicKey authentication so that you don't have to type your
# password for every cipher tested.
set -o pipefail
ciphers="$@"
@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]
@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 / 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 / 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 / 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 / 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 / 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"