Skip to content

Instantly share code, notes, and snippets.

View phdesign's full-sized avatar

Paul Heasley phdesign

View GitHub Profile
@zahmadsaleem
zahmadsaleem / gh-issue-batch-edit.sh
Created March 7, 2021 06:48
Bulk edit github issues
#!/bin/bash
for i in {535..591}
do
gh issue edit $i --milestone "V2.0" --add-project "Kanban Board"
done
@avishayp
avishayp / Dockerfile
Created September 25, 2018 19:02
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
ENV HOME /home/$USER
@ethack
ethack / TypeClipboard.md
Last active April 16, 2024 09:14
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.

@abhayachauhan
abhayachauhan / MustBeVersion.cs
Created September 30, 2015 23:53
Versioning Controller Selector
public class MustBeVersion : IRouteConstraint
{
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values,
RouteDirection routeDirection)
{
var val = values[parameterName] as string;
if (string.IsNullOrEmpty(val)) return false;
int versionNumber;
@warnergodfrey
warnergodfrey / Gemfile
Last active December 14, 2017 01:10
Instructions for running remote JMeter
source 'https://rubygems.org'
gem 'ruby-jmeter', github: 'lukeck/ruby-jmeter'
@sumardi
sumardi / gist:5559896
Created May 11, 2013 12:56
Subdirectory checkouts with Git sparse-checkout
# New repository
mkdir <repo> && cd <repo>
git init
git remote add –f <name> <url>
git config core.sparsecheckout true
echo some/dir/ >> .git/info/sparse-checkout
echo another/sub/tree >> .git/info/sparse-checkout
git pull <remote> <branch>
# Existing repository
@abesto
abesto / curry.bash
Last active February 28, 2024 18:32
Partial application in Bash
function curry() {
exportfun=$1; shift
fun=$1; shift
params=$*
cmd=$"function $exportfun() {
more_params=\$*;
$fun $params \$more_params;
}"
eval $cmd
}