Skip to content

Instantly share code, notes, and snippets.

View pansapiens's full-sized avatar

Andrew Perry pansapiens

  • Melbourne, Australia
View GitHub Profile
@wavezhang
wavezhang / java_download.sh
Last active April 29, 2024 14:42
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@Bklyn
Bklyn / chmodsym.py
Created August 16, 2016 13:27
Symbolic chmod in Python
# Found on https://www.daniweb.com/programming/software-development/code/243659/change-file-permissions-symbolically-linux
""" module chmodsym.py (linux)
This module defines a function chmod(location, description)
which allows to change a file's permission with a symbolic
description of the mode, similar to the shell command 'chmod'.
Tested with python 2.6 and 3.1.
"""
import os, stat
import functools
@ethack
ethack / TypeClipboard.md
Last active May 6, 2024 03:41
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

@fnl
fnl / skript.py
Created June 28, 2015 12:16
Python 3 script/command-line skeleton
#!/usr/bin/env python3
"""
Description
"""
from argparse import ArgumentParser
import logging
import os
import sys
from somewhere import main
@cjdd3b
cjdd3b / fingerprint.py
Created February 22, 2015 14:17
Python implementation of Google Refine fingerprinting algorithms here: https://github.com/OpenRefine/OpenRefine/wiki/Clustering-In-Depth
# -*- coding: utf-8 -*-
import re, string
from unidecode import unidecode
PUNCTUATION = re.compile('[%s]' % re.escape(string.punctuation))
class Fingerprinter(object):
'''
Python implementation of Google Refine fingerprinting algorithm described here:
@gladiatr72
gladiatr72 / 99-salt-minion-init.py
Last active February 26, 2020 20:12
IPython - saltstack profile initializers
# similar initializer for minion-side testing
import salt.config
import salt.client
import salt.loader
import salt.utils.minion as Minion_Util
import salt.config
import pprint
pp_ = pprint.PrettyPrinter(indent=4, depth=20)
pp = pp_.pprint
@moonwatcher
moonwatcher / bcl2fastq_setup.sh
Last active January 6, 2018 20:29
bcl2fastq setup protocol
#!/bin/sh
# Protocol for setting up an environemnt for bcl2fastq 1.8.4
# See: http://seqanswers.com/forums/showpost.php?p=141026&postcount=29
# lior.galanti@nyu.edu
# for bcl2fastq2 see http://backwardincompatible.com/post/169360794395/compiling-illumina-bcl2fastq-220-on-ubuntu-with
# On Ubuntu
sudo apt-get install \
libexpat1-dev \
libexpat1 \
@mlgill
mlgill / rmerge.py
Last active March 8, 2023 18:19
A modified version of pandas merge command that will replace overlapping columns not associated with the join rather than appending a suffix.
import pandas as pa
def rmerge(left,right,**kwargs):
"""Perform a merge using pandas with optional removal of overlapping
column names not associated with the join.
Though I suspect this does not adhere to the spirit of pandas merge
command, I find it useful because re-executing IPython notebook cells
containing a merge command does not result in the replacement of existing
columns if the name of the resulting DataFrame is the same as one of the
@robertpyke
robertpyke / _instructions.md
Last active March 10, 2021 06:41
Interfacing with Nectar's Object Store (swift - Nectar's S3 equivalent)
@proudlygeek
proudlygeek / nfs-tunnel.md
Last active February 13, 2024 17:00
Mount NFS Folder via SSH Tunnel

1. Install NFS on Server

Install the required packages (Ubuntu 12.04):

apt-get install nfs-kernel-server portmap

2. Share NFS Folder

Open the exports file:

vim /etc/exports