Skip to content

Instantly share code, notes, and snippets.

View Pandiora's full-sized avatar

Pandi Pandiora

  • Germoney
View GitHub Profile
@Pandiora
Pandiora / reverse-filenames.sh
Created April 1, 2020 15:36
Reverse filenames
#grabbed from: https://github.com/michaelw85/reverse-filenames
#!/bin/bash
# Change to current dir.
cd "$(pwd)"
# Check if a parameter is given
if [[ -e $1 ]]
then # if a selection is found, just count the files in that selection
files="$1"
@Pandiora
Pandiora / port_forward.md
Created March 26, 2020 06:27 — forked from tsabat/port_forward.md
port forwarding bash script

We hide the services behind an AWS Security Group. But, we can use some trusty SSH action to forward localhost ports to those on the Solr server.

After you've added this to your ~/.zshrc or ~/.bash_profile and sourced (source ~/.bash_profile) it, you can forward these ports from localhost to your server like so:

portforward <hostname>

zsh and bash handle string splitting differently, so be sure to choose correctly for your shell.

@Pandiora
Pandiora / pyload.init
Created August 8, 2019 01:43 — forked from nimble-123/pyload.init
pyload daemon
#!/bin/sh
### BEGIN INIT INFO
# Provides: pyload
# Required-Start: $syslog $local_fs $network $remote_fs
# Required-Stop: $syslog $local_fs $network $remote_fs
# Should-Start: $remote_fs $named
# Should-Stop: $remote_fs $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@Pandiora
Pandiora / gist:3d534f21fd6b79d660f64877b10805f3
Created May 7, 2019 02:51 — forked from csexton/gist:3772971
/etc/init.d/znc startup script
#! /bin/sh
### BEGIN INIT INFO
# Provides: znc
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: znc initscript
# Description: This is the init-Script for znc.
### END INIT INFO
# Author: Henner M. Kruse
@Pandiora
Pandiora / knick-knack-bot.js
Last active January 16, 2019 18:00 — forked from jabczyk/knick-knack-bot.js
Consume all knick knacks in your inventory - Really! Or maybe?
/*
Removed useless info about the author - advertise yourself if you actually know what you're doing - THX!
Probably not one single bit is left from the original source, since Mister Advertiser actually ignored
all the different item-types. Kerikek (sleep is my copy-pasta of another copy-pasta ...∞)
So how to use this crap?
1. you don't need to load your inventory, but it would be a good idea to reload the site one time before you start
(your inventory site -> https://steamcommunity.com/my/inventory/)
2. open your developer-tools and go to console (maybe press F12)
3. paste this script to your console and execute it by hitting enter if you want to consume all your knick knacks
@Pandiora
Pandiora / winterNomination.js
Created December 21, 2018 13:29
Script for automated nominations of Steam Awards 2018 (Winter)
/*
This script is used to automatically log into Steam with every unlimited account
and randomly voting for one game/dev without visiting the nominations-page itself
(the like for Discovery Queue Script by XPaw)
Generate below object with this script when on nominations-page
var cat = $J('.category_nominations_ctn').map(function(){ return $J(this).data('voteid')});
var obj = {};
@Pandiora
Pandiora / wait-el.js
Last active December 7, 2022 10:29 — forked from chrisjhoughton/wait-el.js
Wait for an element to exist on the page with jQuery
// altered to version like described in comments and passing back selector
// to be used later with that or whatever var one chooses
// maxTimes should be used to not have a neverending timeout loop
const waitForEl = (selector, maxTimes = false, callback) => {
// wait for selector until it exists and pass it back
if (jQuery(selector).length) {
callback(selector);
} else {
if (maxTimes === false || maxTimes > 0) {
(maxTimes != false) && maxTimes-- ;
@Pandiora
Pandiora / gist:2bcc47f2d734ed149328b45016d3ae97
Created December 12, 2018 05:15 — forked from ozh/gist:5439013
Crontab template
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
# * * * * * command --arg1 --arg2 file1 file2 2>&1
@Pandiora
Pandiora / ns-create.sh
Last active December 12, 2018 04:50 — forked from dagli/ns-create.sh
Setup a network namespace with Internet access
#!/usr/bin/env bash
set -x
NS="e1ns"
ETH="eth0"
VETH="veth0"
VPEER="veth1"
VETH_ADDR="10.200.1.1"
VPEER_ADDR="10.200.1.2"