Skip to content

Instantly share code, notes, and snippets.

View silpol's full-sized avatar
🏠
Email is best comm tool.

Andriy Tymchenko silpol

🏠
Email is best comm tool.
View GitHub Profile
@that0n3guy
that0n3guy / gist:905c812c0f65e7ffb5ec
Last active December 20, 2023 11:13
Mautic nginx config
server {
# see: http://wiki.nginx.org/Pitfalls
# see: http://wiki.nginx.org/IfIsEvil
listen 80;
root /app;
index index.html index.htm index.php;
error_page 404 /index.php;
# Make site accessible from http://set-ip-address.xip.io
@adamkaplan
adamkaplan / Uncached DNS, new connection
Last active January 16, 2023 03:34
Use Curl to identify bottlenecks in your service layers.
# SSL request to hostname that is not in DNS
> curl -o /dev/null -w @curlformat https://beta.finance.yahoo.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 255k 0 255k 0 0 233k 0 --:--:-- 0:00:01 --:--:-- 233k
Size: 261255
DNS: 0.522
Connect: 0.536
#!/usr/bin/env python
"""A noddy fake smtp server."""
import smtpd
import asyncore
class FakeSMTPServer(smtpd.SMTPServer):
"""A Fake smtp server"""
def __init__(*args, **kwargs):
@burgalon
burgalon / AccountAuthenticator.java
Last active July 15, 2023 08:29
Implementing OAuth2 with AccountManager, Retrofit and Dagger
public class AccountAuthenticator extends AbstractAccountAuthenticator {
private final Context context;
@Inject @ClientId String clientId;
@Inject @ClientSecret String clientSecret;
@Inject ApiService apiService;
public AccountAuthenticator(Context context) {
super(context);
@hwdsl2
hwdsl2 / .MOVED.md
Last active May 4, 2024 03:19
IPsec VPN Server Auto Setup Script for Ubuntu and Debian
@elliottb
elliottb / fabfile.py
Created December 2, 2013 02:26
Example Python Fabric deployment script. Deploys code from a deployment box to a remote host. Usage from command line on the deployment box: fab deploy.
from fabric.api import local, run, env, put
import os, time
# remote ssh credentials
env.hosts = ['10.1.1.25']
env.user = 'deploy'
env.password = 'XXXXXXXX' #ssh password for user
# or, specify path to server public key here:
# env.key_filename = ''
@scaryguy
scaryguy / change_primary_key.md
Last active April 8, 2024 14:23
How to change PRIMARY KEY of an existing PostgreSQL table?
-- Firstly, remove PRIMARY KEY attribute of former PRIMARY KEY
ALTER TABLE <table_name> DROP CONSTRAINT <table_name>_pkey;
-- Then change column name of  your PRIMARY KEY and PRIMARY KEY candidates properly.
ALTER TABLE <table_name> RENAME COLUMN <primary_key_candidate> TO id;
@deepesh-agarwal
deepesh-agarwal / net_priority.sh
Last active February 10, 2022 15:57
Linux Traffic Prioritization Script
#!/bin/bash
# Personal note : add rules to /etc/rc.local file so they will be loaded after booting up
# Change modemif to your network interface value
modemif=eth0
iptables -t mangle -N ack
iptables -t mangle -A ack -m tos ! --tos Normal-Service -j RETURN
iptables -t mangle -A ack -p tcp -m length --length 0:128 -j TOS --set-tos Minimize-Delay
iptables -t mangle -A ack -p tcp -m length --length 128: -j TOS --set-tos Maximize-Throughput
@deanrather
deanrather / create-package.md
Last active March 15, 2024 04:55
Creating a .deb Package

Creating a .deb Package

This creates a package which runs an install.sh which copies a file somewhere the below is entirely incorrect. Hopefully I'll get around to fixing it tip: this would install to the root dir & the relative path to ./install.sh would be wrong

go to project directory

cd /path/to/project