Skip to content

Instantly share code, notes, and snippets.

View thomasjsn's full-sized avatar

Thomas Jensen thomasjsn

View GitHub Profile
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface list member
add interface=ether1 list=WAN
/ip firewall address-list
add address=192.168.0.0/16 list=Bogon
add address=10.0.0.0/8 list=Bogon
@croossin
croossin / .gitlab-ci.yml
Created February 26, 2019 15:51
GitLab CD for Vue.js app to AWS S3
stages:
- build
- deploy
build prod:
image: node:10.15.0-stretch
stage: build
only:
- tags
script:
@larstobi
larstobi / ipv6-6rd-enable.sh
Last active July 31, 2022 02:32
IPv6 Rapid Deployment for Altibox
#!/bin/vbash
# https://sosdg.org/edgerouter/6rd
# https://community.ubnt.com/t5/EdgeMAX/Edgerouter-Lite-on-Centurylink-1-Gbit-fiber/td-p/1124318/page/2
export SBIN="/opt/vyatta/sbin/my_"
export DESCRIPTION="Altibox IPv6 6rd tunnel"
export WAN_DEV="eth2"
export LAN_DEV="eth1"
export TUN_DEV="tun0"
@PeterRincker
PeterRincker / SortGroup.vim
Last active December 26, 2024 12:17
Sort groups of lines in vim
" :[range]SortGroup[!] [n|f|o|b|x] /{pattern}/
" e.g. :SortGroup /^header/
" e.g. :SortGroup n /^header/
" See :h :sort for details
function! s:sort_by_header(bang, pat) range
let pat = a:pat
let opts = ""
if pat =~ '^\s*[nfxbo]\s'
let opts = matchstr(pat, '^\s*\zs[nfxbo]')
@mrbar42
mrbar42 / README.md
Last active April 9, 2025 18:03
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@sticilface
sticilface / PROGMEM.md
Last active July 23, 2023 11:38
PROGMEM

Guide to PROGMEM on ESP8266 and Arduino IDE

Intro

On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string" and it will use up RAM.

The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply

#define PROGMEM   ICACHE_RODATA_ATTR
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@mikoim
mikoim / README.md
Last active March 30, 2025 06:04
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@sebastiaanluca
sebastiaanluca / NewMessage.php
Last active January 29, 2025 12:47
Laravel + Redis + NodeJS + Socket.io pub/sub secure server and client supporting multiple rooms, channels, users, … Add `client.js` to your client app, run `node server.js`, and trigger the Laravel event any way you want to broadcast the data.
<?php
namespace App\Events;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;
class NewMessage extends Event implements ShouldBroadcast
{
@jbq
jbq / haproxy.cfg
Last active March 11, 2018 09:30
Haproxy SSL reverse proxy configuration for Docker registry
global
log 127.0.0.1 local0 debug
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
tune.ssl.default-dh-param 2048
defaults
log global