Skip to content

Instantly share code, notes, and snippets.

@eayin2
eayin2 / gist:f98738cd0a2ad7a353ec29ff56d98dd9
Created January 12, 2024 16:56
nginx.conf Reverse Proxy to forward to the frontend and BFF
events {}
http {
server {
server_name phw.devfra;
location = / {
proxy_pass https://phw.devfra:4200/ui;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@eayin2
eayin2 / fzf.bash
Created April 28, 2023 21:33
Bash functions using fzf
# Bash functions using fzf
#######################################
# Find a file with fzf and open it with `xdg-open`.
# ARGUMENTS:
# Root search path
#######################################
function f() {
# Without root search path $HOME is used by default
i="${@-~}"
@eayin2
eayin2 / gist:07eee6710aced89608f5fe85ce4f7676
Created June 23, 2021 15:33 — forked from shaiguitar/gist:1032229
check processes with kill -0
usage()
{
echo "./$0 [--verbose]"
}
VERBOSE=0
if [ "$1" == "--verbose" ]; then
VERBOSE=1
fi
@eayin2
eayin2 / calculator.py
Created September 28, 2020 17:08
Calculator with numpy, scipy and sympy
import code
import numpy as np
import os
import sympy as sp
import sympy
from fractions import Fraction
from numpy import *
from numpy.linalg import *
# Overwrite cos, sin of numpy with sympy. This could cause issues with other functions. If it
#!/usr/bin/python3
import os
import sys
import subprocess
from subprocess import PIPE
# Description:
# - Mounts encfs before backups and unmonts afterwards. If mount fails the job will be cancled.
# - In your bacula job add:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import os
import psycopg2
import sys
from subprocess import Popen,PIPE
# Description:
# Deletes volumes, which are associated with failed jobs.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import os
import sys
import traceback
import time
from datetime import datetime
from subprocess import Popen, PIPE
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import os
import sys
import traceback
from datetime import datetime
from subprocess import Popen,PIPE
import psycopg2
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import os
import sys
import traceback
import time
from datetime import datetime
from subprocess import Popen, PIPE
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import os
import sys
import traceback
import time
from datetime import datetime
from subprocess import Popen, PIPE