Skip to content

Instantly share code, notes, and snippets.

jc00ke /
Created Jul 14, 2022 — forked from alexishida/
Tutorial to configure Nginx client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Convert SSL certificate from CRT format to PEM

openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
View Convert PostgreSQL to SQLite
1. Dump the data only sql to file
$ pg_dump --data-only --inserts YOUR_DB_NAME > dump.sql
2. scp to local
3. Remove the SET statements at the top
such as:
SET statement_timeout = 0;
SET client_encoding = 'SQL_ASCII';
4. Remove the setval sequence queries
#!/usr/bin/env bash
set -ex
trap 'handleError' ERR
handleError() {
echo ""
echo "If you encountered an error, please consider fixing"
echo "the script for your environment and creating a pull"
jc00ke /
Created May 25, 2022
Migrate Firefox from snap back to deb on Ubuntu Jammy+
#!/bin/env bash
sudo snap remove firefox
sudo add-apt-repository ppa:mozillateam/ppa
echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
jc00ke / gist:078cbe23ac56e76ee0a8ee64523b62dc
Created May 25, 2022
Migrate apt-key to keyrings file
View gist:078cbe23ac56e76ee0a8ee64523b62dc
> sudo apt-key list
# find last 8 of public signature, for example ABCD EFGH for jc00ke
> sudo apt-key export ABCDEFGH | sudo gpg --dearmour -o /usr/share/keyrings/jc00ke.gpg
> sudo -H gedit /etc/apt/sources.list.d/jc00ke.list
# add [arch=amd64 signed-by=/usr/share/keyrings/jc00ke.gpg] after deb
> sudo apt update
> sudo apt-key del ABCDEFGH
# summarized from
#!/usr/bin/env bash
# nice colors
# random filename for the lock; see below
jc00ke / Ubuntu default sound input and
Created Nov 18, 2021 — forked from ChriRas/
Set up default audio device on Ubuntu 20.04 LTS
View Ubuntu default sound input and


I have a notebook connected to a port replicator. I want to use the build-in speakers and microfone and not the external ones. If I boot my notebook in my port replicator Ubuntu changes the devices to external.


  1. Find your internal speaker
pactl list short sinks
jc00ke / unicode-format.txt
Created Nov 10, 2021
Very nice formatting
View unicode-format.txt
═══╦════ ═══╦════ ═══╦════ ═╦══ ═╦══ ═╦══
║ ║ ║ ║ ║ ╚╡► Database-dependent
║ ║ ║ ║ ╚═════╡► Port number
║ ║ ║ ╚══════════╡► Hostname
║ ║ ╚═════════════════╡► Password
║ ╚══════════════════════════╡► Username
╚═════════════════════════════════════╡► Database-dependent
Yanked from
View 50unattended-upgrades
// Automatically upgrade packages from these (origin:archive) pairs
// Note that in Ubuntu security updates may pull in new dependencies
// from non-security sources (e.g. chromium). By allowing the release
// pocket these get automatically pulled in.
Unattended-Upgrade::Allowed-Origins {
// Extended Security Maintenance; doesn't necessarily exist for
// every release and this system may not have it installed, but if
jc00ke / debug-ooo.js
Last active Aug 11, 2021
Google AppScript to add personal calendar OOO events to a shared OOO calendar automatically
View debug-ooo.js
// It doesn't import to a calendar, which uis very convenient when dealing
// with recurring events that can muddy up the shared calendar.
// Set the ID of the team calendar to add events to. You can find the calendar's
// ID on the settings page.
// Set the email address of the Google Group that contains everyone in the team.
// Ensure the group has fewer than 500 members to avoid timeouts.