Skip to content

Instantly share code, notes, and snippets.

@logicrime
logicrime / accwords.rb
Created September 7, 2015 01:52
accwords
#!/usr/bin/ruby
# free 4 u 2 use
# hayden jones
# this can take any number of files as arguments
# eg: ./accwords junk.txt junk2.txt junk3.txt
# and accumulates each letter
# a = 1, b = 2 ... z = 26
# it prints out the final result
@JosephRedfern
JosephRedfern / Speedtest
Last active September 16, 2015 21:35
Scaleway ARM machine
root@beryllium:~# wget http://cachefly.cachefly.net/100mb.test
converted 'http://cachefly.cachefly.net/100mb.test' (ANSI_X3.4-1968) -> 'http://cachefly.cachefly.net/100mb.test' (UTF-8)
--2015-09-03 11:28:49-- http://cachefly.cachefly.net/100mb.test
Resolving cachefly.cachefly.net (cachefly.cachefly.net)... 62.210.187.96
Connecting to cachefly.cachefly.net (cachefly.cachefly.net)|62.210.187.96|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: '100mb.test'
100mb.test 100%[==========================================================================================================================================>] 100.00M 50.1MB/s in 2.0s
@miku
miku / filterfile
Last active December 23, 2015 10:29
filter file by line number
#!/bin/bash
#
# filterline keeps a subset of lines of a file.
#
# cf. http://unix.stackexchange.com/q/209404/376
#
set -eu -o pipefail
if [ "$#" -ne 2 ]; then
echo "Usage: filterline FILE1 FILE2"
@feralhosting
feralhosting / lftp-old.sh
Last active August 29, 2015 14:18
LFTP - Automated sync from seedbox to home SFTP script - original
#!/bin/sh
login="username"
pass="password"
host="server.feralhosting.com"
remote_dir="/folder/you/want/to/copy"
local_dir="/cygdrive/s/lftp/somefolder/where/you.want/your/files/"
trap "rm -f /tmp/synctorrent.lock" SIGINT SIGTERM
if [ -e /tmp/synctorrent.lock ]
then
@flowolf
flowolf / prosody.cfg.lua
Created January 6, 2015 17:39
Prosody Config
-- Prosody XMPP Server Configuration
--
-- Information on configuring Prosody can be found on our
-- website at http://prosody.im/doc/configure
--
-- Tip: You can check that the syntax of this file is correct
-- when you have finished by running: luac -p prosody.cfg.lua
-- If there are any errors, it will let you know what and where
-- they are, otherwise it will keep quiet.
--
@exec
exec / prosody.cfg.lua
Created October 29, 2014 19:05
Some good prosody config ideas
ssl = {
key = "/etc/prosody/certs/domain-private.key";
certificate = "/etc/prosody/certs/domain-cert.crt";
options = { "no_sslv2", "no_sslv3", "no_ticket", "no_compression", "cipher_server_preference" };
ciphers = "kECDH:HIGH:!MEDIUM:!LOW:!NULL:!DSS:!AES128-SHA:!AES128-SHA256:!CAMELLIA128-SHA:!aNULL@STRENGTH";
dhparam = "/etc/prosody/dhparam.pem";
};
c2s_require_encryption = true
@codyopel
codyopel / ffmpeg-progressbar.sh
Created August 25, 2014 00:04
FFmpeg with progress bar (re-work)
#!/bin/bash
# File name: ZAVI2MPG - saved in the "nautilus-scripts" directory.
# Author: robz
# Version: 130511
# This is a re-re-work of a previous script for converting .avi television
# files to a "burnable to DVD" format. This time though conversion statistics
# visual output is supplied by the Zenity dialogue. Stats logfile also added.
# File locations in some variables are specific to my PC check "# Vars" first.
# The script is called by right clicking on the ".avi file" then clicking
# the appropriate choice in the nautilus-scripts menu.
@lyoshenka
lyoshenka / ngrok-selfhosting-setup.md
Last active September 28, 2025 09:54
How to setup Ngrok with a self-signed SSL cert

Intro

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.

DNS

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.

Different Operating Systems

@hassy
hassy / prosody-load-test.md
Last active September 15, 2025 13:20
Quick Prosody load-test

Prosody XMPP Performance Test

Results of a quick performance test for Prosody - a popular open-source XMPP server.

Server

Prosody v0.7 with libevent enabled

Lua 5.1

@scmx
scmx / upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Last active November 6, 2019 15:31
Upgrade/Install ruby 2.1.2 #ubuntu #12.04 #14.04

Upgrade/Install ruby 2.1.2

ubuntu 12.04 14.04

Reference http://stackoverflow.com/a/18490935/2037928

Login as root

Install needed packages

apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev