Skip to content

Instantly share code, notes, and snippets.

View agalazis's full-sized avatar
🦁
https://youtu.be/a-BOSpxYJ9M?feature=shared&t=2129

Andreas Galazis agalazis

🦁
https://youtu.be/a-BOSpxYJ9M?feature=shared&t=2129
View GitHub Profile
@Sinkler
Sinkler / settings.py
Created July 22, 2019 15:23
Show SQL traceback in Django
if os.environ.get('DEBUG_SQL') or os.environ.get('DEBUG_SQL_TRACEBACK'):
LOGGING['loggers']['django.db.backends'] = {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
}
if os.environ.get('DEBUG_SQL_TRACEBACK'):
import traceback
import logging
@udomsak
udomsak / postman_fc29_install.sh
Created December 24, 2018 17:00
Install postman on Fedora core 29 - Dec 2018
#!/bin/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman-linux-x64.tar.gz
sudo tar xvzf postman-linux-x64.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat << EOF > ~/.local/share/applications/postman2.desktop
[Desktop Entry]
Name=Postman
GenericName=API Client
@Nihhaar
Nihhaar / linux_performance.md
Created September 18, 2017 18:42 — forked from marianposaceanu/linux_performance.md
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@duluca
duluca / awc-ecs-access-to-aws-efs.md
Last active October 11, 2024 16:44
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

@vzaliva
vzaliva / ThinkLight
Created May 22, 2016 14:27
This script controll keyboard backlight on IBM ThinkPad X-series
#!/bin/bash
# Vadim Zaliva [email protected]
# based on https://gist.github.com/hadess/6847281
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@vodolaz095
vodolaz095 / install.sh
Last active January 31, 2021 10:00
Little script to help me installing Fedora 32 linux on my home PCs (comment lines you do not need)
#!/bin/sh
echo "Start SSHD service"
systemctl enable sshd
systemctl start sshd
echo "Remove junky programs i hate"
dnf -y remove clipit asunder gnomebaker lxmusic gnumeric osmo pidgin xpad
echo "Upgrade system"
@bennadel
bennadel / average-age.js
Created December 24, 2015 19:25
The Best Way To Compute The Average Age Of Cat Owners In Functional Programming
var _ = require( "lodash" );
// Assume a collection that has:
// - age: Number
// - hasCat: Boolean
var people = require( "./people.json" );
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
@revolunet
revolunet / python-es6-comparison.md
Last active November 2, 2024 12:22
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@lopezjurip
lopezjurip / README.md
Last active September 10, 2023 06:27
Write to NTFS on OSX Yosemite and El Capitan

OUTDATED, see comments below

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
@jas-
jas- / class.stream.php
Last active June 2, 2022 18:22
PHP stream handler w/ support for multiple files over PUT
<?php
/**
* stream - Handle raw input stream
*
* LICENSE: This source file is subject to version 3.01 of the GPL license
* that is available through the world-wide-web at the following URI:
* http://www.gnu.org/licenses/gpl.html. If you did not receive a copy of
* the GPL License and are unable to obtain it through the web, please
*