Skip to content

Instantly share code, notes, and snippets.

View afriza's full-sized avatar

Afriza N. Arief afriza

  • Indonesia
  • 02:48 (UTC +07:00)
View GitHub Profile
@afriza
afriza / sqlite_cpp-cli.cpp
Created May 13, 2011 04:01
SQLite ADO.NET Provider with C++/CLI
// sqlite_cpp-cli.cpp
// Demonstrate SQLite ADO.NET Provider with C++/CLI
#include "stdafx.h"
#using "System.Data.SQLite.dll" // put this file in the project directory
using namespace System;
using namespace System::Data::SQLite;
int main(array<System::String ^> ^args)
@afriza
afriza / jgit.cmd
Created June 11, 2011 08:07
Batch file wrapper to call JGit.Pgm JAR in Microsoft Windows
@REM Author: Afriza N. Arief <[email protected]>
@REM ### automatically search for common JRE/JDK folder path ###
@echo off
set JAVA_CMD=
set JGIT_JAR=
set JGIT_EXT=.JAR;.SH
set JGIT_FILE_PATTERN=*jgit.pgm*
if not defined JAVA_HOME for /d %%d in ("C:\Program Files\Java\jre*") do set JAVA_HOME="%%d"
@afriza
afriza / redsocks.conf
Created July 21, 2011 13:42
Setup iptables for RedSocks in OpenWRT
base {
// debug: connection progress & client list on SIGUSR1
log_debug = on;
// info: start and end of client session
log_info = on;
/* possible `log' values are:
* stderr
* file:/path/to/file
@afriza
afriza / .clang_complete
Created March 22, 2012 11:13
.clang_complete for kernel module development
-std=gnu89
-I/lib/modules/3.0.0-16-generic/build/include/
-I/lib/modules/3.0.0-16-generic/build/arch/x86/include/
-D__KERNEL__
-DMODULE
@afriza
afriza / sc_mon.sh
Created April 2, 2014 02:21
Shoutcast Scripts to during start up and to keep it running
#!/bin/sh
#!/usr/bin/perl
### Shoutcast (SC_SERV)
# Taken from: http://forums.winamp.com/showthread.php?postid=2487604
## SC_SERV Server 1
if ( ! ps auxwww | grep "/home/user/sc_serv/sc_serv /home/user/sc_serv/sc_serv.conf" | grep -v grep )
then echo "Shoutcast not running..."
@afriza
afriza / twinkle-auto-call-answer.go
Last active April 22, 2020 17:43
Twinkle Linux SIP/VoIP auto call and auto answer via command line
package main
import (
"bufio"
"context"
"flag"
"fmt"
"log"
"os/exec"
"strings"
@afriza
afriza / install-nginx-rtmp-module.sh
Last active December 31, 2023 22:04
Install NGINX RTMP module with HLS support on Ubuntu 18.04
sudo apt install curl gnupg2 ca-certificates lsb-release
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
sudo apt update
NGINX_VERSION=$(apt show nginx | grep "^Version" | cut -d " " -f 2 | cut -d "-" -f 1)
# take note of the nginx version in the "stable" release. e.g. 1.14.2
echo NGINX version $NGINX_VERSION
wget https://hg.nginx.org/pkg-oss/raw-file/default/build_module.sh
chmod a+x build_module.sh
@afriza
afriza / install-ffmpeg-with-decklink-support-ubuntu-18.04-server.md
Last active May 6, 2024 22:45
Compiling and installing `ffmpeg` with Decklink SDK on Ubuntu 18.04 Server. Check out forks of this gist for more up-to-date info.
@afriza
afriza / HTTPS-LetsEncrypt-nginx.md
Created April 11, 2019 03:48
Installing HTTPS for NGINX with Let's Encrypt on Ubuntu 18.04

Installing HTTPS for NGINX with Let's Encrypt on Ubuntu 18.04

  • First, install add-apt-repository
    sudo apt install software-properties-common
  • Then, install certbot
    sudo add-apt-repository ppa:certbot/certbot
    sudo apt install python-certbot-nginx
@afriza
afriza / admin.sql
Last active June 7, 2024 07:35 — forked from Hikingyo/admin.sql
create admin user with all privileges on mysql/mariadb
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
## remote connection - not secure
CREATE USER 'admin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
# Optional for MySQL 8.0
CREATE USER 'admin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'some_pass';