This has been incorporated in a small library.
#!/bin/bash | |
#Usage ./gistToken.sh USERNAME (don't forget to chmod+x it) | |
#Inspired in http://www.lornajane.net/posts/2012/github-api-access-tokens-via-curl | |
curl -v -u $1 -X POST https://api.github.com/authorizations --data "{\"scopes\":[\"gist\"]}" |
#!/bin/sh | |
# ================================================================ | |
# | |
# Convert a mysql database dump into something sqlite3 understands. | |
# | |
# Adapted from | |
# http://stackoverflow.com/questions/489277/script-to-convert-mysql-dump-sql-file-into-format-that-can-be-imported-into-sqlit | |
# | |
# (c) 2010 Martin Czygan <martin.czygan@gmail.com> |
# A simple cheat sheet of Spark Dataframe syntax | |
# Current for Spark 1.6.1 | |
# import statements | |
from pyspark.sql import SQLContext | |
from pyspark.sql.types import * | |
from pyspark.sql.functions import * | |
#creating dataframes | |
df = sqlContext.createDataFrame([(1, 4), (2, 5), (3, 6)], ["A", "B"]) # from manual data |
#!/bin/bash | |
# | |
# This script backups an OS X system to an external volume, effectively | |
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for | |
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy | |
# Cloner. The latter website has an interesting list[5] on what files to | |
# exclude when cloning. | |
# | |
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt | |
# |
#!/bin/bash | |
# This script takes a PDF or list of PDFs and outputs a file(s) | |
# named <file>_scanned.pdf that looks like it has been scanned | |
# | |
# Requires imagemagic and popper to be installed (brew install imagemagick poppler) | |
# | |
# Accepts: a list of files | |
# Usage: ./<scriptfilename> pdf1.pdf pdf2.pdf | |
# | |
# To use as a macOS automator quick action you need to: |
In the following gist I'm going to guide you through the process of installing and booting an entire linux distribution with full desktop environment just like you would have with a classical VM, but with much better performance and much worse isolation :)
The reason why I did this was mainly because it's cool, but also to test new distros with decent graphics performance without actually booting them on my PC.
If you "try this at home" just keep in mind a container is not as secure as a VM, and some of the option we're going to explore will weaken container isolation from "a bit risky" to "totally unsafe" depending on what you choose.
Also, we're going to use systemd-nspawn for containers as it's probably the best fit for our use case and can also boot any linux partition without needing to prepare an apposite container image.
Less go!
The plan is to create a pair of executables (ngrok
and ngrokd
) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok
to connect to this ngrokd
, and vice versa.
Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com
, you'll need a record for that and for *.domain.com
.