Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile
@mikroskeem
mikroskeem / index.php
Last active August 29, 2015 14:15
Led blinker made in Raspberry Pi cluster building @ Tartu
<html>
<meta charset="utf-8">
<body>
<h1>Led test</h1>
<button onClick="b()"><span id="lol"></span></button>
<script>
var is_running="<?php
if($_GET["run"] == "1"){
shell_exec("/home/pi/suid -c '/home/pi/vilguta.sh' >/dev/null"); echo "1";
} else if($_GET["run"] == "0"){
@mikroskeem
mikroskeem / fortune.desktop
Created March 11, 2015 12:38
Displays fortune on login
[Desktop Entry]
Type=Application
Name=Fortune notification
Comment=Fortune in notification
Exec=/home/mark/bin/fortune.py
OnlyShowIn=GNOME;
X-GNOME-Autostart-Phase=Application
@asmagill
asmagill / gist:4b792359c7a01da46b2d
Last active November 19, 2021 10:14
Bash resize terminal function

I forget where I found this, so if anyone wants to claim attribution, let me know and I'll add a line here. If put into /etc/profile.d/serial-console.sh, the following will auto size a serial terminal windows size and create a function for manually adjusting later. Since I access RPIs and BBBs via the serial console, their tty names are already listed in the case statement; add others if your system is different. rsz helps when you later reconnect and minicom or screen is in a different sized window...

    rsz() {
        if [[ -t 0 && $# -eq 0 ]];then
                local IFS='[;' escape geometry x y
                echo -ne '\e7\e[r\e[999;999H\e[6n\e8'
                read -sd R escape geometry
                x=${geometry##*;} y=${geometry%%;*}
                if [[ ${COLUMNS} -eq ${x} && ${LINES} -eq ${y} ]];then

echo "${TERM} ${x}x${y}"

var child_process = require('child_process'),
http = require('http');
url = require('url'),
ffmpeg = null;
var livestream = function (req, resp) {
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible).
var input = 'udp://225.1.1.1:8208';
@mikroskeem
mikroskeem / vimrc.vim
Last active February 7, 2016 22:34
Tiny (neo)vim config
" ###### Many settings, wow'
" Better tab completion
set wildmode=longest,list,full
" Airline does this already
set noshowmode
" Do not use double space on some characters
set ambiwidth=single
" Remove startup screen
set shortmess+=I
@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active April 28, 2024 16:35
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@learncodeacademy
learncodeacademy / pubsub.js
Created July 29, 2015 02:54
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@not-much-io
not-much-io / pipeline.py
Last active September 3, 2015 09:21
python pipeline
def inc(x):
return x + 1
def pipe(val, *args):
for func in args:
val = func(val)
return val
pipe(1, inc, inc, inc)
@xor-gate
xor-gate / 01README.md
Last active March 11, 2024 12:05
Semhosting

QEMU Cortex-m3 with semihosting

@p3t3r67x0
p3t3r67x0 / openssl_commands.md
Last active May 22, 2024 02:19
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl