Skip to content

Instantly share code, notes, and snippets.

🐢
Learning rust and PostgreSQL

Lars-Magnus Skog ralphtheninja

🐢
Learning rust and PostgreSQL
Block or report user

Report or block ralphtheninja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View xvfb.init
#!/bin/bash
#
# /etc/rc.d/init.d/xvfbd
#
# chkconfig: 345 95 28
# description: Starts/Stops X Virtual Framebuffer server
# processname: Xvfb
#
View levelup.md
module levelup
version
downloads in the
last 30 days
total downloads
level-sublevel ~0.19.0 151,300 1,226,226
pouchdb 1.3.8 124,983 1,162,731
browserify-fs ^0.18.2 100,027 458,142
pouchdb-adapter-leveldb-core 1.3.8 97,566 419,461
level-packager ~1.3.0 74,165 758,119
merkle-patricia-tree ^1.2.1 13,231 127,025
dynalite ^1.3.3 10,553 258,090
mosca ^1.3.8 9,513 171,844
@ralphtheninja
ralphtheninja / gist:a75614b6dddfdb8c71720cdab57b7013
Created Aug 16, 2017 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:a75614b6dddfdb8c71720cdab57b7013

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ralphtheninja
ralphtheninja / readme.md
Created Jul 20, 2017 — forked from maxogden/readme.md
DIY DAT DYNDNS
View readme.md

for ubuntu, to set up a dynamic dns service that tells you what the external ip of some machine is

  • npm install dat lil-pids run-every add-to-systemd -g
  • mkdir ipdat; cd ipdat; dat create; cd ..;
  • edit file services with this:
cd ipdat && dat sync
cd ipdat && run-every 3600 curl ipinfo.io/ip > ip.txt
@ralphtheninja
ralphtheninja / cleanup_docker.sh
Created Dec 22, 2016 — forked from jaronkk/cleanup_docker.sh
Cleanup and reset docker on Jenkins workers / slaves
View cleanup_docker.sh
#!/bin/bash
# This script should be located on each Jenkins slave, and the jenkins user should have permission to run it with sudo
# Attempts to cleanly stop and remove all containers, volumes and images.
docker ps -q | xargs --no-run-if-empty docker stop
docker ps -q -a | xargs --no-run-if-empty docker rm --force --volumes
docker volume ls -q | xargs --no-run-if-empty docker volume rm
docker images -a -q | xargs --no-run-if-empty docker rmi -f
# Stops the docker service, unmounts all docker-related mounts, removes the entire docker directory, and starts docker again.
@ralphtheninja
ralphtheninja / gpgmutt.md
Created May 19, 2016 — forked from bnagy/gpgmutt.md
Mutt, Gmail and GPG
View gpgmutt.md

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@ralphtheninja
ralphtheninja / getting-started.md
Created May 7, 2016 — forked from joepie91/getting-started.md
Getting started with Node.js
View getting-started.md

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Javascript refresher

Especially if you normally use a different language, or you only use Javascript occasionally, it's easy to misunderstand some of the aspects of the language.

These links will help you refresh your knowledge of JS, and make sure that you understand the OOP model correctly.

View package.json
{
"name": "utp-hole-punching",
"dependencies": {
"utp-native": "*",
"discovery-channel": "*"
}
}
View backup
#!/bin/bash
SERVER=yourwebsite.com
tar -cjf- ~/.crypt/passwd ~/.ssh ~/.bashrc ~/.profile ~/.vimrc ~/.gitconfig \
~/.config/chromium ~/.mozilla \
| openssl enc -aes-256-cbc \
| ssh $SERVER 'cat>~/www/backup/`date +%F.%T`'
ssh $SERVER 'ls -1 ~/www/backup | grep ^[0-9] | sort > ~/www/backup/list.txt'
View pull.js
/*
create a simple source stream that reads from an array.
A pull stream is just an async stream that is called repeatedly.
note that when every item in the array has been called back,
it returns true in the error slot. This indicates the end of the stream.
both err and end mean the stream is over! but there are many possible
ways an error can occur (err && err !== true), and only one way a stream can correctly end (true)
You can’t perform that action at this time.