Skip to content

Instantly share code, notes, and snippets.

@bitboxx
bitboxx / README.md
Created February 1, 2020 06:01 — forked from ethack/TypeClipboard.md
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.

@bitboxx
bitboxx / gist:9ff53b40b5112282ef6919dc4d524cb3
Created January 7, 2018 17:36
Erase and upload firmware on ESP8266 using esptool.py
# Remember to change the serial device
# Erase flash
esptool.py --port COM3 erase_flash
# Upload
esptool.py --port COM3 write_flash -fs 1MB -fm dout 0x0 firmware.bin
@bitboxx
bitboxx / gist:00d9fe0a8cd3189c337e8fecbec02905
Created November 29, 2017 15:20
Chrome flags to disable CORS and SSL check (high security risk, only run for testing)
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --ignore-certificate-errors --disable-web-security --user-data-dir
@bitboxx
bitboxx / gist:3834818cf2b6331c4ff386212eb53f05
Created May 30, 2017 10:19
Set MacOS Keyboard repeat rate
# In terminal
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 20
# Then logout / login or restart
@bitboxx
bitboxx / osx_ramdisk.sh
Last active August 23, 2018 09:08 — forked from jnschulze/osx_ramdisk.sh
Create Ramdisk on Mac
#!/bin/bash
MOUNT_PATH=~/tmp/RamDiskCache
mkdir -p ${MOUNT_PATH}
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://8388608`
echo "Ramdisk device: ${DISK}"
@bitboxx
bitboxx / copyListToClipboard.js
Last active February 27, 2017 08:55
Copy list on a website to clipboard
// Get certain list from website and copy it to clipboard
window.copyListToClipboard = (selector, elementProperty, linePrefix = '') => {
let list = '';
document.querySelectorAll(selector).forEach(element => {
list += linePrefix + element.getAttribute(elementProperty) + '\n';
});
copy(list);
}
@bitboxx
bitboxx / gist:bd62069b95bc7b2dd67d35e1bed51dd3
Created February 20, 2017 16:35
My standard ZSH user configuration
# Filename: /etc/skel/.zshrc
# Purpose: config file for zsh (z shell)
# Authors: (c) grml-team (grml.org)
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
################################################################################
# Nowadays, grml's zsh setup lives in only *one* zshrc file.
# That is the global one: /etc/zsh/zshrc (from grml-etc-core).
# It is best to leave *this* file untouched and do personal changes to
# your zsh setup via ${HOME}/.zshrc.local which is loaded at the end of
adb reboot bootloader
# Wait for device to restart
fastboot boot twrp...img
# TWRP > Advanced > Terminal
echo SYSTEMLESS=true >> /data/.supersu
# TWRP install ZIP
Open SuperSU.zip file
@bitboxx
bitboxx / gist:aff61c4cb06d5a5f1e5b536b62665cac
Last active February 15, 2017 09:07
Install Docker on CentOS 7 (and maybe higher)
# Copy paste in terminal
# Source: https://docs.docker.com/engine/installation/linux/centos/
sudo yum install -y yum-utils makecache fast
sudo yum-config-manager \
--add-repo \
https://docs.docker.com/engine/installation/linux/repo_files/centos/docker.repo
sudo yum -y install docker-engine
sudo systemctl enable docker
sudo systemctl start docker
@bitboxx
bitboxx / hashCode.js
Created January 19, 2016 09:43
Javascript hashCode function
/**
* Javascript hashCode function
* This function is a modified version of 'Javascript implementation of Java’s String.hashCode() method'
*
* Modifications:
* - Added comments
* - Added string length caching
* - Regular function instead of String.prototype
* - Variable char (reserved word) is renamed to tmpChar.