Skip to content

Instantly share code, notes, and snippets.

@bitboxx
bitboxx / README.md
Created Feb 1, 2020 — forked from ethack/TypeClipboard.md
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.
View README.md

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 Jan 7, 2018
Erase and upload firmware on ESP8266 using esptool.py
View gist:9ff53b40b5112282ef6919dc4d524cb3
# 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 Nov 29, 2017
Chrome flags to disable CORS and SSL check (high security risk, only run for testing)
View gist:00d9fe0a8cd3189c337e8fecbec02905
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --ignore-certificate-errors --disable-web-security --user-data-dir
View gist:3834818cf2b6331c4ff386212eb53f05
# 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 Aug 23, 2018 — forked from jnschulze/osx_ramdisk.sh
Create Ramdisk on Mac
View osx_ramdisk.sh
#!/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 Feb 27, 2017
Copy list on a website to clipboard
View copyListToClipboard.js
// 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 Feb 20, 2017
My standard ZSH user configuration
View gist:bd62069b95bc7b2dd67d35e1bed51dd3
# 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
View gist:dc5329efe052fee67c26d37f5787e3e4
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 Feb 15, 2017
Install Docker on CentOS 7 (and maybe higher)
View gist:aff61c4cb06d5a5f1e5b536b62665cac
# 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 Jan 19, 2016
Javascript hashCode function
View hashCode.js
/**
* 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.