Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| server: | |
| ########################################################################### | |
| # BASIC SETTINGS | |
| ########################################################################### | |
| # Time to live maximum for RRsets and messages in the cache. If the maximum | |
| # kicks in, responses to clients still get decrementing TTLs based on the | |
| # original (larger) values. When the internal TTL expires, the cache item | |
| # has expired. Can be set lower to force the resolver to query for data | |
| # often, and not trust (very large) TTL values. | |
| cache-max-ttl: 86400 |
As configured in my dotfiles.
start new:
tmux
start new with session name:
Typing vagrant from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)| #! /bin/bash | |
| # ECHO COMMAND | |
| # echo Hello World! | |
| # VARIABLES | |
| # Uppercase by convention | |
| # Letters, numbers, underscores | |
| NAME="Bob" | |
| # echo "My name is $NAME" |
I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.
Imagine a long-running development branch periodically merges from master. The
git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.
It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.
| #!/bin/bash | |
| # Referenced and tweaked from http://stackoverflow.com/questions/6174220/parse-url-in-shell-script#6174447 | |
| proto="$(echo $1 | grep :// | sed -e's,^\(.*://\).*,\1,g')" | |
| # remove the protocol | |
| url="$(echo ${1/$proto/})" | |
| # extract the user (if any) | |
| userpass="$(echo $url | grep @ | cut -d@ -f1)" | |
| pass="$(echo $userpass | grep : | cut -d: -f2)" | |
| if [ -n "$pass" ]; then |
| # List all possible power config GUIDs in Windows | |
| # Run: this-script.ps1 | Out-File powercfg.ps1 | |
| # Then edit and run powercfg.ps1 | |
| # (c) Pekka "raspi" Järvinen 2017 | |
| $powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting | |
| $powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup | |
| Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingCapabilities | ForEach-Object { | |
| $tmp = $_.ManagedElement |
| # Got a bunch of .ckpt files to convert? | |
| # Here's a handy script to take care of all that for you! | |
| # Original .ckpt files are not touched! | |
| # Make sure you have enough disk space! You are going to DOUBLE the size of your models folder! | |
| # | |
| # First, run: | |
| # pip install torch torchsde==0.2.5 safetensors==0.2.5 | |
| # | |
| # Place this file in the **SAME DIRECTORY** as all of your .ckpt files, open a command prompt for that folder, and run: | |
| # python convert_to_safe.py |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs