Skip to content

Instantly share code, notes, and snippets.

View jnbek's full-sized avatar

John D Jones III jnbek

View GitHub Profile
@jnbek
jnbek / json.lua
Created December 7, 2022 00:42 — forked from tylerneylon/json.lua
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.

Conversion without lose of Quality

ffmpeg -i file.mov -c copy out.mp4

you can remove audio by using the -an flag

Conversion with Compression

ffmpeg -i input.mov -vcodec libx264 -crf 20 output.mp4
@jnbek
jnbek / devops_borat.dat
Created October 21, 2021 18:01 — forked from textarcana/devops_borat.dat
The wisdom of Devops Borat (RIP, may Taichi Ohno himself carry him into Valhalla!) condensed in fortune cookie format without any @ messages included. Just the goofiest random shit :)
I remember very clear I cry when I finish volume 3 of Knuth.
%
I am work on CSS SQL.
%
First sign of depression in devops is denial: you start of ignore Nagios alert.
%
In devops language is not success unless is another language++.
%
In devops you are addict to graph if first thought after orgasm is send duration and intensity to Graphite.
%
@jnbek
jnbek / xvfb.service
Created August 27, 2017 17:32 — forked from mylk/xvfb.service
Xvfb systemd script
# /etc/systemd/system/xvfb.service
[Unit]
Description=X virtual framebuffer
[Service]
Type=simple
User=root
ExecStart=/usr/bin/Xvfb :99 -ac
@jnbek
jnbek / dbus.sh
Created June 1, 2017 14:35 — forked from biboudis/dbus.sh
Playing with dbus.
# qdbus lists all service names of services that are running and you can manipulate at the moment.
qdbus
# control dbus
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
# and use --literal if you need to print the reply in plain text
qdbus --literal org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Playlists.ActivatePlaylist /org/mpris/MediaPlayer2/Playlists/20
@jnbek
jnbek / nginx.vhost
Created December 18, 2016 23:43 — forked from vedovelli/nginx.vhost
server {
listen 80;
server_name CHANGEME.app;
root /var/www/vhosts/CHANGEME.app/public;
index index.html index.htm index.php;
charset utf-8;
location / {
@jnbek
jnbek / getCurrentPosition_canvas.html
Created December 8, 2015 21:21 — forked from strongwave/getCurrentPosition_canvas.html
A Demo Drawing Google Map on Canvas Tag for HTML5
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
jQuery(window).ready(function(){
g_initialize();
jQuery("#findLocationBtn").click(initiate_geolocation);
});
@jnbek
jnbek / ping_api.rc
Last active December 22, 2016 03:10 — forked from dynax60/ping_api.rc
Example of FreeBSD rc-file for Mojolicious Hypnotoad Server
#!/bin/sh
# PROVIDE: ping_api
# REQUIRE: NETWORKING
# KEYWORD: shutdown
. /etc/rc.subr
name="ping_api"
rcvar=`set_rcvar`
#!/bin/sh
#
# PROVIDE: plack_app
# REQUIRE: LOGIN
# BEFORE: cron
#
# Add the following lines to /etc/rc.conf to enable the webapp:
# plack_app_enable (bool): Set to "NO" by default.
#! /usr/bin/perl
use strict;
use warnings;
use utf8;
use IO::Socket::INET6;
use LWP::UserAgent;
## Use IO::Socket::INET6 instead of IO::Socket::INET6 in Net::HTTP.
BEGIN {