Skip to content

Instantly share code, notes, and snippets.

View ivankristianto's full-sized avatar

Ivan Kristianto ivankristianto

View GitHub Profile
@ivankristianto
ivankristianto / README.md
Created November 19, 2021 07:45 — forked from MarMed/README.md
Routing plex traffic through an SSH tunnel

Routing plex traffic through an SSH tunnel

This guide creates a reverse SSH tunnel to route all Plex server traffic through it.

Step 2 is done on the tunnel, all other steps are done on the plex server.

1. Setup SSH keys (if you already have key based authenthication setup skip to step 2)

On plex server:

@ivankristianto
ivankristianto / README.md
Last active April 18, 2021 10:27
PiHole Exporter as Background Service

Compile pihole-exporter

git clone https://github.com/eko/pihole-exporter.git  
cd pihole-exporter/  
GO111MODULE=on go mod vendor  
GOOS=linux GOARCH=arm GOARM=7 go build -o pihole_exporter .  
chmod +x pihole_exporter  
@ivankristianto
ivankristianto / tf-how-to-start.md
Last active October 15, 2020 03:36
TensorFlow How to Start
@ivankristianto
ivankristianto / devDependencies.js
Created March 4, 2020 08:02
Webpack Config in WordPress
"devDependencies": {
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.4",
"@babel/plugin-syntax-dynamic-import": "^7.2",
"@babel/plugin-transform-runtime": "^7.6.0",
"@babel/polyfill": "^7.6.0",
"@babel/preset-env": "^7.6.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.4.4",
"@babel/traverse": "^7.5.5",
@ivankristianto
ivankristianto / Install PIP to user site on macOS.md
Created December 28, 2019 18:25 — forked from haircut/Install PIP to user site on macOS.md
How to install and use pip without sudo or admin on macOS

Install and use pip on macOS without sudo / admin access

Most recently tested on macOS Sierra (10.12.6)

  1. Download the installation script; curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
  2. Run the installation, appending the --user flag; python ~/Downloads/get-pip.py --user. pip will be installed to ~/Library/Python/2.7/bin/pip
  3. Make sure ~/Library/Python/2.7/bin is in your $PATH. For bash users, edit the PATH= line in ~/.bashrc to append the local Python path; ie. PATH=$PATH:~/Library/Python/2.7/bin. Apply the changes, source ~/.bashrc.
  4. Use pip! Remember to append --user when installing modules; ie. pip install <package_name> --user

Note

@ivankristianto
ivankristianto / decrypt.php
Last active April 21, 2021 13:42
Encrypt & Decrypt with PHP
<?php
/**
* Decrypts a value.
*
* If a user-based key is set, that key is used. Otherwise the default key is used.
*
* @since 1.0.0
*
* @param string $raw_value Value to decrypt.
* @param string $key Key to use for encryption.
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
"benchmarkIndex": 1175.6487025948104
},
"lighthouseVersion": "3.2.1",
"fetchTime": "2018-11-02T06:10:34.128Z",
"requestedUrl": "https://2018.kualalumpur.wordcamp.org/",
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@ivankristianto
ivankristianto / functions.php
Created July 14, 2018 07:56
Add Auto ADS AMP Script for WordPress
/**
* Echo AMP Auto Ads Script
*/
function ik_amp_extended_component() {
echo '<script async custom-element="amp-auto-ads" src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js"></script>';
}
add_action( 'amp_post_template_head', 'ik_amp_extended_component', 25 );
@ivankristianto
ivankristianto / ga.json
Created July 14, 2018 03:45
Google Analytics JSON Template for AMP WordPress
{
"vars": {
"account": "UA-XXXXXXX-Y"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
},
"trackClick": {