Skip to content

Instantly share code, notes, and snippets.

@devster31
devster31 / etc-apt-apt.conf.d-02nocache
Last active October 9, 2015 22:19 — forked from anonymous/etc-apt-apt.conf.d-02nocache
Customization for rpi minimal images
Dir::Cache {
srcpkgcache "";
pkgcache "";
}
@devster31
devster31 / swap.yml
Last active February 28, 2024 10:43 — forked from manuelmeurer/swap.yml
Ansible role for creating a Swap file
- name: set swap_file variable
set_fact:
swap_file: /{{ swap_space }}.swap
- name: check if swap file exists
stat:
path: "{{ swap_file }}"
register: swap_file_check
- name: create swap file
@devster31
devster31 / nginx.conf
Last active December 16, 2021 15:40
OS optimizations for ec2 t2.micro - WIP
# https://www.nginx.com/blog/tuning-nginx/
worker_connections 1024;
# Limit the number of connections NGINX allows, for example from a single client
# IP address. Setting them can help prevent individual clients from opening too
# many connections and consuming too many resources.
server {
# When several limit_conn directives are specified, any configured limit will apply.
limit_conn perip 10;
limit_conn perserver 100;
@devster31
devster31 / down_list.txt
Last active November 18, 2015 14:38
requires html5lib, beautifulsoup4 and requests, only works with userscloud.com
https://userscloud.com/svmwe8593ehb/100th_Anniversary_Special_-_Guardians_of_the_Galaxy_01_(2014)_(digital)_(Minutemen-Faessla).cbz
https://userscloud.com/lb7fh14rhb08/Guardians_of_the_Galaxy_(FCBD_2014)_(digital)_(Minutemen-Spaztastic).cbr
https://userscloud.com/x3qo53t7kc8a/Guardians_of_the_Galaxy_-_Galaxy's_Most_Wanted_001_(2014)_(Digital)_(Zone-Empire).cbr
https://userscloud.com/0mjhxiqs2581/Guardians_of_the_Galaxy_000.1_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/x5zaf6r3jl1j/Guardians_of_the_Galaxy_001_(2013)_(21_Covers)_(Tarutaru-Novus-HD).cbr
https://userscloud.com/4crnaof2xs2z/Guardians_of_the_Galaxy_001_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/uqv1f5ck7f0m/Guardians_of_the_Galaxy_002_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/8v0giwb7viz1/Guardians_of_the_Galaxy_003_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/sp46pfmmey9i/Guardians_of_the_Galaxy_004_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/502nh7yuldeo/Guardians_o
@devster31
devster31 / day1.rb
Last active December 25, 2015 17:15
Advent of Code challenges - http://adventofcode.com
string = "<example string>"
string.count('(') - string.count(')')
count = 0
string.split('').each_with_index { |char, index|
if char == '(' then
count += 1
elsif char == ')' then

Keybase proof

I hereby claim:

  • I am devster31 on github.
  • I am devster (https://keybase.io/devster) on keybase.
  • I have a public key ASA9TOe1FftRr064ouxzqKdIdFMzNojdIjj1mqNPRGy-MAo

To claim this, I am signing this object:

@devster31
devster31 / example.html
Last active February 6, 2024 01:30
Bookmark parser for the NETSCAPE-Bookmark-file-1 format in node. Don't hesitate to comment with feedback.
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html#//apple_ref/doc/-%20uid/TP40014508" ADD_DATE="1414706885" PRIVATE="0" TAGS="javascript,mac,osx,yosemite">JavaScript for Automation Release Notes</A>
<DD>This article describes JavaScript for Automation, a new feature in OS X Yosemite.
@devster31
devster31 / dailyprogrammer-278-part1.go
Created August 12, 2016 21:04
r/dailyprogrammer 278 part 1
package main
import (
"bytes"
"fmt"
"strings"
)
type Interleave struct {
opType, first, second string
@devster31
devster31 / batch.ps
Created April 23, 2017 23:04
Convert .mov files into .mp4 files on Windows without re-encoding video
$oldvids = Get-ChildItem -Filter "*.mov" -Recurse
foreach ($oldvid in $oldvids) {
$newvid = [io.path]::ChangeExtension($oldvid.FullName, '.mp4')
ffmpeg -i $oldvid.FullName -y -c:v copy -c:a libvo_aacenc -b:a 256k $newvid
}
@devster31
devster31 / BUGS.R
Last active May 5, 2017 21:20
Bayesian analysis of OPTIMISE trial (OpenBUGS and JAGS versions)
source("~/Doing_Bayesian_Analysis/openGraphSaveGraph.R")
source("~/Doing_Bayesian_Analysis/plotPost.R")
require(BRugs)
modelstring = "
# BUGS model specification begins here...
model {
# Likelihood. Each complication/death is Bernoulli.
for ( i in 1 : N1 ) { y1[i] ~ dbern( theta1 ) }
for ( i in 1 : N2 ) { y2[i] ~ dbern( theta2 ) }