Skip to content

Instantly share code, notes, and snippets.

TomTasche /
Created August 1, 2021 20:10
Recreating boot disk of a live instance from last snapshot on Google Cloud Platform
# stop instance
gcloud compute instances stop YOURINSTANCE --zone=YOURZONE
# remove boot disk from instance
gcloud compute instances detach-disk YOURINSTANCE --zone=YOURZONE --disk YOURDISK
# delete old boot disk
gcloud compute disks delete YOURDISK --zone=YOURZONE
# find last snapshot
TomTasche / chrome-remote-desktop-session
Created July 20, 2021 13:51
Chrome Remote Desktop to Ubuntu Server
# install ubuntu-desktop
# follow
# put this in /etc/chrome-remote-desktop-session
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
exec env GNOME_SHELL_SESSION_MODE=ubuntu /usr/bin/gnome-session --session=ubuntu
TomTasche / appsscript.js
Last active February 10, 2022 09:51
Remove access for user from multiple files on Google Drive -
function main() {
function findSharedDocuments(email) {
var files = DriveApp.searchFiles('("' + email + '" in readers OR "' + email + '" in writers) AND NOT ("' + email + '" in owners)');
var success = 0;
while (files.hasNext()) {
var file =;
try {
TomTasche /
Created October 19, 2017 12:27
generate random file, send to server and print time
echo "time_total: %{time_total}\n" > curl_format.txt
dd if=/dev/urandom of=data.txt bs=100K count=1
while true; do curl -X POST -w "@curl_format.txt" -d @data.txt -s; done;
TomTasche / nginx.conf
Last active January 27, 2023 21:22
config for nginx to proxy a specific path to an S3 bucket
# copied from default config
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/;
events {
worker_connections 1024;
TomTasche /
Last active June 20, 2017 13:30
do not automatically mount apple devices in ubuntu (fix for mounting iphone in mac-guest in vmware)
# if you're running mac osx inside a vmware virtual machine, mounting an iphone into it can be cumbersome because ubuntu always claims the device for itself.
# sometimes it still works to mount it into the vm, but most of the time it doesn't.
# to fix that we simply never mount apple-devices on our ubuntu host, so that vmware is able to claim them for the guest.
# this ignores all apple usb-devices on your ubuntu host!
echo 'ATTRS{idVendor}=="05ac", ENV{UDISKS_IGNORE}="1"' | sudo tee /etc/udev/rules.d/100-local.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
# install node
curl -sL | sudo -E bash -
sudo apt-get install git nodejs --yes
# fix npm permissions:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo "export PATH=~/.npm-global/bin:\$PATH" >> ~/.profile
depending on your specific scenario you might want to try to inject one of those:
<img onerror="window.alert('hey')" src="bla"/>
<img onerror="window.onerror=alert;throw 'hey'" src="bla"/>
<script>window.onerror=alert;throw "hey";</script>
sudo apt-get update --yes
sudo apt-get upgrade --yes
curl -sSO
sudo bash
sudo rm
sudo apt-get install git default-jdk maven --yes
logger "started"
sudo apt-get update --yes
sudo apt-get upgrade --yes
cd worker/
git clean -fdx
git checkout master