Skip to content

Instantly share code, notes, and snippets.

View alunux's full-sized avatar

La Ode Muhammad Fadlun Akbar alunux

  • Chiba, Japan
View GitHub Profile
@alunux
alunux / json_parser.c
Created May 2, 2017 18:28 — forked from alan-mushi/json_parser.c
Examples for the json-c tutorial.
/*
* A simple example of json string parsing with json-c.
*
* clang -Wall -g -I/usr/include/json-c/ -o json_parser json_parser.c -ljson-c
*/
#include <json.h>
#include <stdio.h>
int main() {
struct json_object *jobj;
@alunux
alunux / test-mediakeys.c
Last active August 29, 2017 22:36
It will control spotify playback. Compile: gcc -Wall `pkg-config --cflags --libs gio-2.0` test-mediakeys.c -o test-mediakeys
/*
* Copyright (C) 2017 La Ode Muh. Fadlun Akbar <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@alunux
alunux / nginxproxy.md
Created October 28, 2017 09:29 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@alunux
alunux / session-install.patch
Created November 15, 2017 04:45
blankon-session-makefile
diff --git a/files/bin/Makefile.am b/files/bin/Makefile.am
index ebd451c..67f86bc 100644
--- a/files/bin/Makefile.am
+++ b/files/bin/Makefile.am
@@ -1,5 +1,5 @@
-all:
+install:
install -m 755 blankon-session $(bindir)
-CLEANFILES= \
@alunux
alunux / konsole-blur.sh
Created November 24, 2017 10:41
Make konsole's background blur (Works on ZSH)
## Blur effect for Konsole ##
if [[ $(ps --no-header -p $PPID -o comm) =~ '^yakuake|konsole$' ]]; then
for wid in $(xdotool search --pid $PPID); do
xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $wid; done
fi
#!/bin/bash
# Coba: ./cek-hari-kerja 07 Agustus 2017
declare -A bulanku=(
["januari"]="1"
["februari"]="2"
["maret"]="3"
["april"]="4"
["mei"]="5"
grep -v '^#\|^\s*$' lokasi_berkasnya.conf
## Workaround openstack nova+openvswitch mtu issues when no jumbo frames are available,
## by setting up udev at neutron-gateway to hook on routing interface creation to
## lower the MTU (thus trigger ICMPs for PMTU discovery)
## See: https://blueprints.launchpad.net/neutron/+spec/network-options-mtu
## keywords: openstack, nova, openvswitch, mtu, 1500, no jumbo frames
## Create these two files:
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@alunux
alunux / gist:bea31b7753895487e635ec7036df1d32
Created May 1, 2018 01:08 — forked from evildmp/gist:3094281
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using: