Skip to content

Instantly share code, notes, and snippets.

View bashizip's full-sized avatar
🌍

Patrick Bashizi bashizip

🌍
View GitHub Profile
@kurokobo
kurokobo / docker-compose-installer-for-container-optimized-os-on-gce.md
Last active March 29, 2024 17:50
Simple Installer for Docker Compose on Container-Optimized OS on Google Computing Engine

Simple Installer for Docker Compose on Container-Optimized OS on Google Computing Engine

The easiest way to make Docker Compose available on Container-Optimized OS on Google Compute Engine (GCE) on Google Cloud Platform (GCP).

This is minimal Bash script version of Community Tutorial.

How to use

Simply, download installer.sh, run it, and then reload bash by source ~/.bashrc or re-login.

@gmolveau
gmolveau / how_to_reverseproxy_proxypass_nginx_letsencrypt.md
Last active May 2, 2024 19:19
How to use nginx as a reverse-proxy with letsencrypt

How to use nginx as a reverse-proxy with letsencrypt

Your infrastructure

generated via plantuml

Imgur

Requirements

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@jirawatee
jirawatee / MyFirebaseMessagingService.java
Last active July 14, 2022 20:58
FCM - MyFirebaseMessagingService.java
package com.example.fcm;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active April 10, 2024 10:53
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@rvanbruggen
rvanbruggen / 1-load_gtdb_script.cql
Last active February 18, 2020 13:06
Global Terrorism Database
//load Global Terrorism Database
//Copy/Paste the load script below into your Neo4j-shell command-line utility
//In order to accelerate the loading process, you want to download the CSV file from
//https://www.dropbox.com/s/oequ58lrp8f9w6v/gtdb_transform.csv?dl=1 and then to a local file.
//After that, you would of course need to replace the URL in all of the queries below, and replace it with
//load csv with headers from "file:/path/to/your/file.csv" as csv
//load the countries
load csv with headers from "https://www.dropbox.com/s/oequ58lrp8f9w6v/gtdb_transform.csv?dl=1
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@bashizip
bashizip / gist:9d87d9edb59a5bfe405c
Last active August 29, 2015 14:05
Kannel Acces Logs Parser , Writes outputs to CSV ( Excel ) File
package kannellogsparser;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.StringTokenizer;
/**
@rponte
rponte / some_links.md
Last active January 19, 2022 07:48
Some interesting articles about JPA/Hibernate Multi-Tenancy
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 3, 2024 20:51
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)