-
First make sure to install
rsubin Bash (follow the tutorial here) and make sure it is in the $PATH environment variable. -
Create a symlink to the windows executable of Sublime Text so it is the $PATH (I use the
~/bin/directory that I created). I did this by adding the following lines to my~/.bashrcbecause I have found symlinks to be buggy in the Bash environment. This ensures the symlink is re-created each time Bash starts up. (Note: your installation path to the Sublime Text executable may vary)$ ln -sfn "$HOME/bin/wsub" "/mnt/d/Program Files/Sublime Text 3/subl.exe"
Sometimes you need to edit a file on a remote server, but using vim/emacs is not very practical, due to lag and speed of screen refresh.
TextMate users have the classic rmate, but it was implemented in Ruby, which may not be available on the remote server.
A better option is to use this version of rmate, implemented in pure Bash. It's a single file, self-contained, and with no external dependencies.
Step by step:
-
Flash the latest kernel onto an SD card using the instructions here: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
-
Mount the SD card and browse to the boot partition using a file browser
-
Enable the USB controller by opening up the
config.txtfile and adding a new line which contains the following:dtoverlay=dwc2 -
Enable the ethernet gadget driver by opening up the
cmdline.txtfile and add the following text to the end of the line:modules-load=dwc2,g_ether
| def expand(lst): | |
| """" | |
| Expand a list/tuple of lists/tuples of lists/tuples of ... of values into a single list | |
| """ | |
| exp = [] | |
| for item in lst: | |
| if type(item) is list or type(item) is tuple: | |
| exp += expand(item) | |
| else: | |
| exp.append(item) |
| #!/usr/bin/env python | |
| import random | |
| faces = ["U","D","L","R","F","B"] | |
| modifiers = ["", "'", "2"] | |
| min_scramble_len = 16 | |
| max_scramble_length = 20 |
I hereby claim:
- I am connorjan on github.
- I am connorjan (https://keybase.io/connorjan) on keybase.
- I have a public key whose fingerprint is DB55 6494 216F CD37 478A D420 DFE6 88D9 E17E 605D
To claim this, I am signing this object:
This will show how you can setup scripts that will run on bootup of a Raspberry Pi. Any user in the /home/ directory where the name of the user matches the name of their home directory will be able to take advantage of this setup, as well as the root user.
- Add the following code to the file:
/etc/rc.local, but be sure to leave the last line of the file asexit 0
# Startup scripts
## Root
if [ -f /root/startup.sh ]; then| import socket | |
| import struct | |
| import argparse | |
| import binascii | |
| parser = argparse.ArgumentParser(version="0.1",description='Magic packet sender') | |
| parser.add_argument('--mac', action="store", default=None, required=True, help="The mac address to wake up") | |
| arg = parser.parse_args() |
| import MySQLdb | |
| import CSServer | |
| import time | |
| """ | |
| This script will update your cs server's maplist file for you based on tiers that are stored in a database. | |
| To get it to work, make sure that you have the 'CSServer.py' file in the same directory as this script, | |
| then change the variables in the 'global variables' section as needed. | |
| This will overwrite the map list file as needed, and will append changes to the new maps text file if enabled. |