This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mount /dev/sda1 /mnt | |
arch-chroot /mnt /usr/bin/rm /etc/vconsole.conf | |
arch-chroot /mnt /usr/bin/pacman -S --noconfirm syslinux | |
arch-chroot /mnt /usr/bin/syslinux-install_update -i -a -m | |
arch-chroot /mnt /usr/bin/sed -i.bak s/sda3/sda1/g /boot/syslinux/syslinux.cfg | |
rm /mnt/etc/fstab | |
echo "tmpfs /tmp tmpfs nodev,nosuid 0 0" > /mnt/etc/fstab | |
echo "/dev/sda1 / ext4 defaults,noatime 0 1" >> /mnt/etc/fstab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# resource ID of the video, can be obtained from the video URL: | |
# https://collegerama.tudelft.nl/Mediasite/Play/485dbc9fac81446bae6b2ba2fe0571ac1d?catalog=cf028e9a-2a24-4e1f-bdb5-2ace3f9cd42d | |
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
id=$1 | |
folder=$2 | |
if [ -f $2 ]; then | |
echo "folder $2 already exists, skipping" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
url = "http://www.nytimes.com" | |
r = requests.get(url) | |
r_html = r.text | |
soup = BeautifulSoup(r_html, "html.parser") | |
storyheadings = soup.select(".story-heading > a") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"github.com/spf13/pflag" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!groovy | |
import groovy.json.JsonOutput | |
import groovy.json.JsonSlurper | |
/* | |
Please make sure to add the following environment variables: | |
HEROKU_PREVIEW=<your heroku preview app> | |
HEROKU_PREPRODUCTION=<your heroku pre-production app> | |
HEROKU_PRODUCTION=<your heroku production app> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fake createOrder. It fails half of the time and had a random runtime between 0 and 1000 ms. | |
*/ | |
async function createOrder() { | |
return new Promise((resolve, reject) => { | |
let action; | |
let returns; | |
if (Math.random() < 0.01) { | |
console.log('action=resolve'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a file named input containing 1, 2, 3, 4 on separate lines | |
// cat input | node serial-readline.js | |
// output (shows bot stdin and stdout): | |
// 1 | |
// start handler | |
// end handler | |
// 2 | |
// 3 | |
// 4processing: 1 | |
// start handler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
async def foo(): | |
print('hello') | |
tasks = [ | |
bar(), | |
bar(), | |
bar(), | |
bar(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Usage: | |
# $ cat ~/.bash_history | ./bash-history-to-zsh-history.py >> ~/.zsh_history | |
import sys | |
import time | |
def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
client=$1 | |
if [ x$client = x ]; then | |
echo "Usage: $0 clientname" | |
exit 1 | |
fi | |
easyrsa_dir="/etc/openvpn/easy-rsa" |
OlderNewer