Skip to content

Instantly share code, notes, and snippets.

View felicemcc's full-sized avatar

Felice Candilio felicemcc

  • Sion, Switzerland
View GitHub Profile
@felicemcc
felicemcc / install-latest-compose.sh
Created June 5, 2022 12:51 — forked from deviantony/install-latest-compose.sh
Install latest version of Docker Compose
#!/bin/bash
## THIS THE THE OLD WAY
## Nowadays, simply follow the Compose installation instructions in the official documentation: https://docs.docker.com/compose/install/
# get latest docker compose released tag
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
@felicemcc
felicemcc / keychron_linux.md
Created May 13, 2022 09:28 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

@felicemcc
felicemcc / postgres_queries_and_commands.sql
Created February 10, 2020 13:05 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@felicemcc
felicemcc / moodleclone.sh
Last active June 7, 2019 08:24 — forked from ragusa87/moodleclone.sh
Liip clone moodle repo (private)
#!/bin/bash
set -xe
MOODLE_REPO=git@gitlab.liip.ch:elearning/moodle.git
MOODLE_CACHE=~/gitcaches/moodle.reference
MOODLE_ALTERNATE_REPO=git@gitlab.liip.ch:elearning/moodle-testmigration.git
MOODLE_ALTERNATE_REPO_NAME=test
if [[ $# -eq 0 ]]; then
echo "Entrez le nom de la branche client: [mdl31-tcs]: "
read branch
else
@felicemcc
felicemcc / viewer.php
Last active June 26, 2017 19:17
PHP Recursive get and show images on a directory and its subdirectories
<?
$dirname = "wp-content/uploads/";
//$images = glob($dirname."*.jpg");
function getDirContents($dir, &$results = array()){
$files = scandir($dir);