Skip to content

Instantly share code, notes, and snippets.

View frosit's full-sized avatar

Fabio Ros frosit

View GitHub Profile
@frosit
frosit / cmds.sql
Created October 20, 2022 14:41
db commands
-- get db size
SELECT round(Sum(data_length + index_length) / 1024 / 1024, 1) as "Size in MB" FROM information_schema.TABLES WHERE table_schema = database();
-- get sizes of all dbs
SELECT table_schema "DB Name",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "MB"
FROM
information_schema.tables
WHERE
@frosit
frosit / maketar.sh
Created June 16, 2022 14:50
make tar
#!/usr/bin/env bash
if [[ "$1" == "-h" || "$1" == "--help" || ! ${1+x} ]]; then cat <<HELP
Creates a tar file of specified file/folder
Usage: $(basename "$0") [folder-to-tar] [{save-as}.tar.gz]
This command will tar the file/folder of the first argument.
It will use the first argument als filename adding .tar.gz
If a second argument is supplied, this will be used as the location/name to save the tar.
@frosit
frosit / cloudflare_dyn_dns.sh
Created December 22, 2021 09:15 — forked from chappy84/cloudflare_dyn_dns.sh
CloudFlare Dynamic DNS Shell Script
#!/bin/sh
#
# CloudFlare Dynamic DNS
#
# Updates CloudFlare records with the current public IP address
#
# Takes the same basic arguments as A/CNAME updates in the CloudFlare v4 API
# https://www.cloudflare.com/docs/client-api.html#s5.2
#
# Use with cron jobs etc.
@frosit
frosit / doctrine-arraycache-missing.patch
Created August 1, 2021 23:11
Patch file that returns missing (deprecated) ArrayCache class, blocking composer install.
---
lib/Doctrine/Common/Cache/ArrayCache.php | 115 +++++++++++++++++++++++
1 file changed, 115 insertions(+)
create mode 100644 lib/Doctrine/Common/Cache/ArrayCache.php
diff --git a/lib/Doctrine/Common/Cache/ArrayCache.php b/lib/Doctrine/Common/Cache/ArrayCache.php
new file mode 100644
index 0000000..eca43b8
--- /dev/null
+++ b/lib/Doctrine/Common/Cache/ArrayCache.php
@frosit
frosit / dbparse.sh
Created April 13, 2021 02:47
Chrome history export support multiple profiles
#!/bin/bash
# Original: https://gist.github.com/TravelingTechGuy/7ac464f6cccde912a6ec7a1e2f8aa96a
#
# Mac: ~/Library/Application\ Support/Google/Chrome/Default/History
#
# Adjustments:
# * Fix: for datetime
# * Mains on visits instead of url's for enhanced stats
# * exports history of every profile instead of default
#
@frosit
frosit / argon1.sh
Last active December 10, 2022 04:19
#!/bin/bash
argon_create_file() {
if [ -f $1 ]; then
sudo rm $1
fi
sudo touch $1
sudo chmod 666 $1
}
@frosit
frosit / launchikvm
Created November 16, 2019 00:12 — forked from eniac111/launchikvm
The script fixes the annoying "no iKVM64 in java.library.path" bug with the Java iKVM laucher of some Supermicro servers :)
#!/bin/bash
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <blagovest@petrovs.info> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return Blagovest Petrov
# ----------------------------------------------------------------------------
# The script fixes the "no iKVM64 in java.library.path" bug with the SuperMicro
# iKVM Java S**t. You can do an alias of it, like: "alias javaws=/usr/local/bin/launchikvm"
@frosit
frosit / minifier.sh
Created September 9, 2017 04:46
Small wrapper for JSMIN/CSSMIN and Convert (PNG)
#!/usr/bin/env bash
# == Minify JS/CSS/PNG Files (requires dependency's) ==
# =================== POC =============================
# == Variables
BINDIR=$(dirname $0)
PROJECTDIR=$(realpath "${BINDIR}/..")
export Red='\033[0;31m' # Red
export Green='\033[0;32m' # Green
export Yellow='\033[0;33m' # Yellow
@frosit
frosit / keybase.md
Last active July 1, 2017 05:10
keybase.md

Keybase proof

I hereby claim:

  • I am frosit on github.
  • I am frosit (https://keybase.io/frosit) on keybase.
  • I have a public key ASDXR1Sio-N5zSrIe715CSYTJqsNRoUQatcnDmclTmxp2go

To claim this, I am signing this object:

@frosit
frosit / phash
Created February 23, 2017 17:36
A small PHP hash script
#!/usr/bin/env php
<?php
/**
* Hash Tool
* =========
*
* Small helper script to PHP's hash functions.
*
* @author Fabio Ros
*