Skip to content

Instantly share code, notes, and snippets.

# easily add aliases to ~/.bash_aliases
function alias2bash {
cat ~/.bash_aliases > ~/.bash_aliasesx;
echo -e "\n# ($(date)) $1\nalias $2=\"$3\"\n" > ~/.bash_aliasesy;
cat ~/.bash_aliasesx ~/.bash_aliasesy > ~/.bash_aliases;
rm ~/.bash_aliasesx ~/.bash_aliasesy;
nubash;
cat ~/.bash_aliases;
}
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
roles:
- admin
- developer
- guest
password:
@armarti
armarti / bash_filthy_console_prank.sh
Last active April 11, 2018 13:21
Print random swear words in the Bash console prompt. Can be unset with `export PS1=$CLEAN_PS1` or `omgicanttakeitanymore-plzmakeitstop`.
#!/usr/bin/env bash
_TMP="${TMP:-/tmp}"
FILTHYDIR="$_TMP/bash_filthy_console_prank_files"
if [ ! -d "$FILTHYDIR" ]; then
THISDIR="$PWD"
cd "$_TMP"
mkdir bash_filthy_console_prank_files
cd bash_filthy_console_prank_files
URL="https://www.freewebheaders.com/wordpress/wp-content/uploads/full-list-of-bad-words-csv-file_2018_03_26_26.zip"
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
"child"|"parent"
"B0"|"A0"
"B1"|"A0"
"B2"|"A0"
"C0"|"B1"
"C1"|"B2"
"C3"|"B1"
#!/bin/bash
cd ~/Downloads/
wget https://download.jetbrains.com/toolbox/jetbrains-toolbox-1.8.3868.tar.gz
sudo add-apt-repository ppa:cleishm/neo4j
sudo apt-get update
sudo apt install -y net-tools aptitude apt-file open-vm-tools-desktop build-essential gdebi
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash
~/.rbenv/bin/rbenv init
rbenv install 2.5.1
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
@armarti
armarti / blank.txt
Created December 11, 2018 10:59
Testing file downloads over HTTPS
NOT!
@armarti
armarti / CMakeSettings_schema.json
Created December 12, 2018 12:21
Copy of CMakeSettings_schema.json installed with Visual Studio 2017
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"environments": {
"type": "array",
"description": "A list of “environment” groups that contain key value pairs defining variables that are applied to each configuration in a the CMakeSettings.json.",
"items": {
"type": "object",
"properties": {
@armarti
armarti / tweaks_setup.sh
Created December 17, 2018 18:08
Tweaks Setup
#!/bin/sh
@armarti
armarti / generate_client_cert.sh
Last active July 18, 2019 03:47
Docker scripts
#!/usr/bin/env bash
# https://docs.docker.com/engine/security/https/#daemon-modes
set -eo pipefail
if [ $UID -ne 0 ]; then
echo "You must run this script as root."
exit 1
fi
CLNT_HOST="$1"
#!/usr/bin/env bash
#if 0
# Original spark: https://zachholman.com/spark/
# C implementation (reproduced below): https://git.zx2c4.com/spark/tree/spark.c
# The first time this file is executed it will compile itself.
echo -n "Compiling for the first time... "
BAK=/tmp/$(basename $0).bak
cp $0 $BAK
sed '1s;^;//;' $0 | gcc -o $0 -xc - -lm
echo "Done. Original code backed up at $BAK."