Skip to content

Instantly share code, notes, and snippets.

View felipe3dfx's full-sized avatar
🎯
Focusing

Felipe Gonzalez felipe3dfx

🎯
Focusing
View GitHub Profile
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"detect_indentation": false,
"display_signatures": false,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"AdvancedNewFile",
"Alignment",
"Anaconda",
@felipe3dfx
felipe3dfx / remove-docker.md
Last active February 15, 2018 20:27
How to remove unused Docker containers and images
  1. Removing all images is

     #!/bin/bash
     $ docker ps -q -a | xargs docker rm -f
    
  2. Removing all containers

     #!/bin/bash
     # Delete all dangling (unused) images
    

docker rmi $( docker images -f dangling=true -q )

@felipe3dfx
felipe3dfx / cachet-lert.js
Last active August 11, 2016 19:16
Alert bar to show information from the closest incident using cachet API
document.addEventListener( 'DOMContentLoaded', function () {
function cachetAlert(cachetUrl) {
var createAlert = function(incident) {
var divElement = document.createElement('div');
divElement.id = 'cachet-alert';
divElement.setAttribute('style', 'background-color: #FF3D2E; text-align: center; font-family: sans-serif;');
divElement.innerHTML = '<a style="color: #fff; display: block; padding: 5px;" href="'+ cachetUrl +'" target="_blank">'+ incident.name +'</a>';
document.body.insertBefore(divElement, document.body.children[0]);
};
# settings.py
'huey.contrib.djhuey',
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'level-and-date': {
'format':
'%(levelname)s\t%(asctime)s\t%(funcName)s\t%(message)s'

Running adhoc commands on multiple servers

Example host file

Using the following /etc/ansible/hosts file:

[app]
192.168.60.4  ansible_user=deploy
192.168.60.5  ansible_user=deploy
@felipe3dfx
felipe3dfx / readme.md
Created February 21, 2019 15:36
Setup google chromium kiosk on raspberry

sudo nano /etc/X11/xorg.conf

Section "ServerFlags"
Option "blank time" "0"
Option "standby time" "0"

Option "suspend time" "0"
Option "off time" "0"
EndSection
@felipe3dfx
felipe3dfx / gist:ea37e038301e17ab335c742d07eff882
Last active October 16, 2024 15:51
Reset django migrations
1. Remove old migrations file
sudo find . -path "*/migrations/*.py" -not -name "__init__.py" -not -path "./.venv/*" -delete
sudo find . -path "*/migrations/*.pyc" -not -path "./.venv/*" -delete
2. Make migrations again
python manage.py makemigrations
3. Truncate django_migrations table
TRUNCATE TABLE django_migrations;
@felipe3dfx
felipe3dfx / nextcloud_s3_policy.json
Created October 2, 2019 19:37
Next Cloud S3 Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListAllBuckets",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketLocation"
],
@felipe3dfx
felipe3dfx / README.md
Last active June 1, 2020 15:42
Setup master server Postgres 12