Skip to content

Instantly share code, notes, and snippets.

View fnkr's full-sized avatar
🐧
cat /dev/urandom | aplay -c 2 -r 24000

Florian Kaiser fnkr

🐧
cat /dev/urandom | aplay -c 2 -r 24000
View GitHub Profile
@fnkr
fnkr / gist:51f0a92b9f0c658287ec
Last active May 12, 2016 09:23
This code allows you to configure phpPgAdmion to automatically login to a particular server and database with a particular default password.
<?php
/*
Automatic Login
(c) 2008 Tim Wood
contact via: tmwood (at) datawranglers (dot) com
You are free to use this code as long as this notice is retained
Description
@pixelbrackets
pixelbrackets / Fluid.html
Last active May 15, 2019 17:24
TYPO3 Neos Backend Conditions
<f:if condition="{node.context.workspace.name} == 'live'">
Only visible in live frontend
</f:if>
<f:security.ifAccess privilegeTarget="TYPO3.Neos:Backend.GeneralAccess">
<f:if condition="{node.context.workspace.name} != 'live'">
Only visible in backend workspace
</f:if>
</f:security.ifAccess>
@iamralch
iamralch / ssh_client.go
Last active April 16, 2023 03:09
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@iamralch
iamralch / sshtunnel.go
Last active April 16, 2023 03:07
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@colinvh
colinvh / aws.md
Last active May 24, 2024 23:35
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@edtjones
edtjones / zabbix_cleanup.sql
Created February 10, 2016 13:55
Clean up zabbix database
SET @history_interval = 7;
SET @trends_interval = 90;
DELETE FROM alerts WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM acknowledges WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM events WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history_uint WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history_str WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
@spiette
spiette / jinja_variables_types.yml
Created March 3, 2016 14:52
Test the variables types in jinja2 templates, used here with ansible
---
- hosts: all
gather_facts: no
vars:
string: "string"
list:
- item1
- item2
dict:
key1: value1
@fnkr
fnkr / random-string.sh
Last active March 31, 2017 08:00
Generate random, alphanumeric strings in Bash.
#!/bin/bash
RANDSTR="$(cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 40)"
@fnkr
fnkr / kirby-subdir.nginxconf
Created May 12, 2016 09:05
Nginx configuration for Kirby A) in domain's root directory (e.g. example.com) B) in subdirectory named /kirbycms/ (e.g. example.com/kirbycms/).
# e.g. for example.com/kirbycms/
location /kirbycms/ {
if (!-e $request_filename) {
rewrite ^/kirbycms/(.*)$ /kirbycms/index.php last;
break;
}
}
@fnkr
fnkr / imagemagick-print-width-height.sh
Last active May 12, 2016 09:21
Print width and height with ImageMagick's identify tool.
identify -format '%wx%h' image.png