Skip to content

Instantly share code, notes, and snippets.

View jonathands's full-sized avatar

Jonathan DS jonathands

View GitHub Profile
@jonathands
jonathands / gist:c0554be97d6e103f65f2c8cdf1bd8c25
Created December 11, 2023 20:01
composer install with www-data user
sudo su -l www-data -s /bin/bash -c "cd $PWD; composer install"
@jonathands
jonathands / gmail-stats.gs
Created June 24, 2023 12:23 — forked from leodevbro/gmail-stats.gs
In Gmail inbox, Find sender with most mail threads
// Original script: https://gist.github.com/leodevbro/2987e8874a18b2086ea6cc1aa3c494e8
// v2.5
// Google Apps Script is a coding language based on JavaScript.
// This Apps Script code helps us to sort addresses by most threads.
// A thread is a group of messages, as a conversation.
const modes = {
inbox: "inbox", // to analyze threads in the "Inbox" folder
outbox: "outbox", // to analyze threads in the "Sent" folder
** This is a Test
asfasdf asdf asdf asdf asdfa sdfa sdfas dfasdf
* 1
* 2
- 3
- 4
@jonathands
jonathands / simple_curl.php
Created November 28, 2022 11:34 — forked from ViliamKopecky/simple_curl.php
Simple cURL wrapper function for GET, POST, PUT & DELETE methods
/**
* Wrapper for easy cURLing
*
* @author Viliam Kopecký
*
* @param string HTTP method (GET|POST|PUT|DELETE)
* @param string URI
* @param mixed content for POST and PUT methods
* @param array headers
* @param array curl options
@jonathands
jonathands / autopgsqlbackup
Created June 8, 2020 01:41 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <[email protected]>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
find ./templates/ -type d -exec rename 's/(.*)\/([^\/]*)/$1\/\u$2/' {} \;
@jonathands
jonathands / glog
Last active June 2, 2020 13:00 — forked from metrofx/glog
Pretty git log, displays 20 last commits.
#!/bin/sh
git --no-pager log -n 20 --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
@jonathands
jonathands / install.sh
Last active May 29, 2020 17:27
amazon php ec2
sudo amazon-linux-extras install epel -y
sudo yum install epel-release -y
sudo yum update -y
sudo amazon-linux-extras install "php7.4" -y
sudo yum install -y httpd php7.4 php-pgsql php-pdo_pgsql php-gd php-intl php-mbstring php-json git awscli certbot certbot-apache
#open ports
aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXXXXX --protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXXXXX --protocol tcp --port 443 --cidr 0.0.0.0/0
@jonathands
jonathands / vhost.sh
Created May 28, 2020 21:46 — forked from Adamwaheed/vhost.sh
Simple Apache Vhost manager
#!/bin/bash
NONE='\033[00m'
RED='\033[01;31m'
GREEN='\033[01;32m'
YELLOW='\033[01;33m'
PURPLE='\033[01;35m'
CYAN='\033[01;36m'
WHITE='\033[01;37m'
BOLD='\033[1m'
@jonathands
jonathands / grabemailsfromfiles.py
Created May 14, 2020 00:40
trying to extract emails on
import os, re, sys
emails = []
current_file = ""
try:
files = os.listdir("msgs")
for f in files:
current_file = f