Skip to content

Instantly share code, notes, and snippets.

View jcchikikomori's full-sized avatar
💭
I may be slow to respond.

John Cyrill Corsanes jcchikikomori

💭
I may be slow to respond.
View GitHub Profile
@jcchikikomori
jcchikikomori / config.txt
Last active September 11, 2021 02:20
DietPi Installation config for Raspberry Pi Zero
# Docs: https://github.com/raspberrypi/documentation/blob/master/configuration/config-txt/README.md
# Overlays: https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README
#-------Display---------
# Max allocated framebuffers: Set to "0" in headless mode to reduce memory usage
# - Defaults to "2" on RPi4 and "1" on earlier RPi models
#max_framebuffers=0
# If you get no picture, set the following to "1" to apply most compatible HDMI settings.
#hdmi_safe=1

Create DNS-over-TLS bridge with Pi-hole, unbound and stubby on Ubuntu Server

Few months ago, I've made a similar work but I wanted something a little more easier to manage. Please have a look at here for my previous work.

This time, I'm gonna do pretty much the same thing but using Pi-hole as base then modify it to include unbound and stubby.

This way, I can use the power of Pi-hole with some additional security layers:

  • Recursive DNS check (unbound)
  • DNS-over-TLS (stubby)

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@jcchikikomori
jcchikikomori / qs.js
Created May 19, 2021 07:10 — forked from cvan/qs.js
get query-string parameters (alternative to `URLSearchParams`)
var queryParams = window.location.search.substr(1).split('&').reduce(function (qs, query) {
var chunks = query.split('=');
var key = chunks[0];
var value = decodeURIComponent(chunks[1] || '');
var valueLower = value.trim().toLowerCase();
if (valueLower === 'true' || value === 'false') {
value = Boolean(value);
} else if (!isNaN(Number(value))) {
value = Number(value);
}
/**
* Targetting iPhone X Series of Smartphones
*
*/
$iphone-x-main-nav-height: 80px;
$iphone-x-main-nav-padding: calc(#{$iphone-x-main-nav-height} / 2);
$iphone-x-header-height: $header-height;
$iphone-x-height-offset: $iphone-x-main-nav-height + $iphone-x-header-height;
@jcchikikomori
jcchikikomori / shareit-blacklist.txt
Last active March 22, 2021 02:18
ShareIt App domain blacklist
shareitgames.com
ushareit.com
*.shareit.com
*.wshareit.com
@jcchikikomori
jcchikikomori / ArchLinuxWSL2.md
Created March 13, 2021 08:42 — forked from ld100/ArchLinuxWSL2.md
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.

Installing Arch Linux

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Here the SDK is under /usr/local/share/android-sdk because I may switch to a different Catalina user in the future, but it works fine under /Users/<your_user>/Library/Android/sdk as well.

Prerequisites:

See for brew, python3 and NodeJS on nvm see gist https://gist.github.com/agrcrobles/3d945b165871c355b6f169c317958e3e

Java 14

@jcchikikomori
jcchikikomori / nullaway-build.gradle
Created August 24, 2020 07:34 — forked from msridhar/nullaway-build.gradle
self-contained build.gradle for using NullAway on an Android app
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
// for android gradle plugin 3
google()
}
dependencies {
@jcchikikomori
jcchikikomori / UserAgentInterceptor.java
Created June 3, 2020 10:29 — forked from twaddington/UserAgentInterceptor.java
Injects a User-Agent header into outgoing OkHttp requests.
package com.enlighthq.mobile.http;
import android.os.Build;
import java.io.IOException;
import java.util.Locale;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;