Skip to content

Instantly share code, notes, and snippets.

View jcchikikomori's full-sized avatar

John Cyrill Corsanes jcchikikomori

View GitHub Profile
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@jcchikikomori
jcchikikomori / Homebrew Install Top Google Fonts.md
Last active November 17, 2022 15:37 — forked from petsto/Homebrew Install Top Google Fonts.md
Quickly install top Google fonts via Homebrew

List of some top fonts for easy terminal install via Homebrew Fonts Cask.

brew install --cask font-open-sans \
 font-noto-sans \
 font-roboto font-roboto-mono font-roboto-slab \
 font-montserrat \
 font-lato \
 font-fira-code \
 font-source-code-pro \
@jcchikikomori
jcchikikomori / README.md
Created March 2, 2022 10:09 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

    cd /tmp
@jcchikikomori
jcchikikomori / launch.json
Created February 17, 2022 07:59 — forked from vaiorabbit/launch.json
VSCode settings for ruby debugging
{
// IntelliSense を使用して利用可能な属性を学べます。
// 既存の属性の説明をホバーして表示します。
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Local File",
"type": "Ruby",
"request": "launch",
@jcchikikomori
jcchikikomori / nginx.conf
Last active March 2, 2022 03:29 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@jcchikikomori
jcchikikomori / AddSSHKeysAtLogin.plist
Created November 3, 2021 10:52 — forked from RichardBronosky/AddSSHKeysAtLogin.plist
Launch ssh-agent on boot (OSX macos)
<plist version="1.0">
<dict>
<key>Label</key>
<string>ssh-add-a</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh-add</string>
<string>-A</string>
</array>
<key>StandardOutPath</key>

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;