Skip to content

Instantly share code, notes, and snippets.

View superhero's full-sized avatar
💭
oɹǝɥɹǝdns

Erik Landvall superhero

💭
oɹǝɥɹǝdns
View GitHub Profile
# settig default permissions, r/rw to your user and your default group
umask 0002
# return if not running interactively
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history
HISTCONTROL=ignoreboth:erasedups
# ignores placing the exit command in history
@superhero
superhero / math.random.seed.js
Created November 25, 2016 10:49
A seeded random generator
(seed) =>
{
const n = Math.sin(seed);
return n - Math.floor(n);
};
@superhero
superhero / npm-publish.sh
Created December 22, 2016 16:25
run in root folder of multiple npm packages to publish them all with 1 command
#!/bin/bash
docker run \
-it \
--rm \
--volume /etc/localtime:/etc/localtime:ro \
--volume `pwd`/.npmrc:/root/.npmrc \ # notice the login credentials that needs to be mounted
--volume `pwd`:/app \
--workdir /app \
node /bin/bash -c "
@superhero
superhero / git-commit-push.sh
Created December 22, 2016 16:28
run in root of multiple projects to commit and push them all at once
#!/bin/bash
# note that all commits will have the same commit message
if [ $# -eq 1 ]; then
MSG=$1
else
read -p "commit message: " MSG
fi
for d in */ ; do
@superhero
superhero / git.md
Last active August 8, 2017 15:18
Git commands...

remove last commit from git and github

git push -f origin HEAD^:master

@superhero
superhero / README.md
Last active September 2, 2021 13:46
When docker swarm fucks with you

From a new installation

sudo usermod -aG docker $USER

Adding your user to the docker group. OBS! Follow up with a login-logout process of the session.


From a manager node