Skip to content

Instantly share code, notes, and snippets.

View MikeDacre's full-sized avatar

Mike Dacre MikeDacre

View GitHub Profile
#!/bin/bash
# Will maximize the current window to a new desktop, or, if the window is not
# Use your window manager's keybindings to attach this script to the key combination of your choice
# Requires the following packages in Ubuntu:
# xdotool x11-utils wmctrl
function goFull() {
echo $1
DESKTOP=`wmctrl -d | cut -d \ -f 1 | tail -1`
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active May 4, 2024 15:04
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
import numpy as np
import scipy.sparse
import scipy.ndimage
import scipy.stats
import scipy.signal
import matplotlib.pyplot as plt
def main():
x, y = generate_data(int(1e7))
@philipsoutham
philipsoutham / build-tmux.sh
Created September 16, 2014 21:40
Build static tmux
#!/usr/bin/env bash
pushd $(dirname $0) > /dev/null; CURRABSPATH=$(readlink -nf "$(pwd)"); popd > /dev/null; # Get the directory in which the script resides
set -x
MUSLPKG="musl:musl.tgz:http://www.musl-libc.org/releases/musl-1.1.4.tar.gz"
LEVTPKG="libevent:libevent2.tgz:https://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz"
TMUXPKG="tmux:tmux.tgz:http://iweb.dl.sourceforge.net/project/tmux/tmux/tmux-1.9/tmux-1.9a.tar.gz"
NCRSPKG="ncurses:ncurses.tgz:http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz"
TEMPDIR="$CURRABSPATH/tmp"
TMPLIB="tempinstall/lib"
TMPINC="tempinstall/include"
@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 00:45
Setting Nginx FastCGI response buffer sizes.
@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@davfre
davfre / bamfilter_oneliners.md
Last active February 24, 2024 01:23
SAM and BAM filtering oneliners
@magthe
magthe / gist:1420199
Created December 1, 2011 21:58
Patch for broadcom-wl to make it shut up about rssi
Index: broadcom-wl/src/src/wl/sys/wl_cfg80211.c
===================================================================
--- broadcom-wl.orig/src/src/wl/sys/wl_cfg80211.c
+++ broadcom-wl/src/src/wl/sys/wl_cfg80211.c
@@ -1466,7 +1466,7 @@ wl_cfg80211_get_station(struct wiphy *wi
scb_val.val = 0;
err = wl_dev_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t));
if (err) {
- WL_ERR(("Could not get rssi (%d)\n", err));
+ // WL_ERR(("Could not get rssi (%d)\n", err));
@amackey
amackey / ncbi_decrypt
Created January 9, 2011 14:16
ncbi_decrypt: utility script to submit decryption jobs to PBS cluster
#!/usr/bin/perl
use strict;
use warnings;
my $path = shift @ARGV;
$path ||= $ENV{PWD};
unless ($path =~ m/^\//) {
$path = "$ENV{PWD}/$path";
@netj
netj / memusg
Last active January 29, 2024 15:04
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #