Skip to content

Instantly share code, notes, and snippets.

View sumsudo's full-sized avatar
🎯
Focusing

sumsudo

🎯
Focusing
  • Software Consultancy Co.,Ltd.
View GitHub Profile
@luizomf
luizomf / postgresql_13_pgadmin_4_ubuntu_20_04.sh
Last active March 24, 2025 15:58
PostgreSQL 13 on Ubuntu 20.04
# Update all your packages
sudo apt update
sudo apt upgrade -y
# Add postgresql repository and key
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# Update again
@ernstki
ernstki / README.md
Last active February 28, 2023 19:48
Create dropshadowed thumbnails with a simple command

thumb - a command-line thumbnailer & drop-shadower

Quickly generate drop-shadowed thumbnails from the command line using ImageMagick's [convert][convert], optionally specifying a maximum geometry for either (or both) dimensions.

Sample images created by this script

You can choose whether or not to draw a thin (1-pixel), grey ([#777][grey]) border around the image, or leave it off with the

@stanly-johnson
stanly-johnson / test.js
Created December 1, 2018 02:02
HD wallet nodejs app
const Web3 = require('web3');
const express = require('express');
const Tx = require('ethereumjs-tx');
const bip39 = require('bip39')
const hdkey = require('hdkey')
const ethUtil = require('ethereumjs-util')
const app = express();
//Infura HttpProvider Endpoint
const web3 = new Web3(new Web3.providers.HttpProvider("https://rinkeby.infura.io/yGEHQFbey55ozzDha3hf"));
@sam016
sam016 / AllGattCharacteristics.java
Last active October 11, 2025 20:01
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@tralston
tralston / reload-config-postgresql.md
Created August 21, 2017 08:18
[Reload PostgreSQL config] After updating pg_hba.conf or postgresql.conf, the server needs the config needs to be reloaded. #postgres

After updating pg_hba.conf or postgresql.conf, the server needs the config needs to be reloaded. The easiest way to do this is by restarting the postgres service:

service postgresql restart

When the service command is not available (no upstart on Synology NAS, for example), there are some more creative ways to reload the config. Note this first one needs to be done under the user that runs postgres (usually the user=postgres).

user#  sudo su postgres
postgres#  pg_ctl reload
@ethanpil
ethanpil / wp-secure.conf
Created May 12, 2017 16:16
Wordpress Security for NginX
# wp-secure.conf
#
#
# This file includes common security considerations for wordpress using nginx.
#
# The goal is to block actions which are usually dangerous to wordpress.
# Additionally, we block direct access to PHP files and folders which should not
# be accessed directly from a browser.
#
# Also have included exceptions for plugins that are known to require this access.
@Unitech
Unitech / app-koa.js
Last active January 20, 2022 11:24
Node.js Load Balancers Benchmark: HAProxy vs Nginx vs PM2
const Koa = require('koa');
const app = new Koa();
app.use(ctx => {
ctx.body = 'Hello World';
});
var listener = app.listen(process.env.PORT || 3000, () => {
console.log(`Listening on port ${listener.address().port}`);
});
@colophonemes
colophonemes / create_triggers
Last active February 1, 2025 14:53
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@fevangelou
fevangelou / my.cnf
Last active August 22, 2025 08:47
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated September 2024 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@nicomollet
nicomollet / wp_auto_install.sh
Last active October 23, 2024 23:23
WP-CLI auto install script
#!/bin/bash
# Default options
LOCALE="fr_FR"
DB_HOST='localhost'
VIRUSTOTAL_KEY='YOUR_KEY'
printf "Name of the project? cf My Project: "
read PROJECT_NAME