Skip to content

Instantly share code, notes, and snippets.

View n1mh's full-sized avatar

Diego Martínez Castañeda n1mh

View GitHub Profile
@chatchavan
chatchavan / README.md
Last active April 27, 2024 20:33
Setup Wifi on Raspberry Pi

Setup Wireless LAN for Raspberry Pi

The following guide describes how to setup Raspberry Pi to connect to Wifi. It was tested on the following environment:

  • Raspberry Pi Model B
  • Edimax EW-7811Un USB Wifi dongle
  • OS: Raspbian Jessie

Here are the overview of the steps:

@vasanthk
vasanthk / System Design.md
Last active November 14, 2025 08:03
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@subfuzion
subfuzion / curl.md
Last active November 6, 2025 06:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@heckctor
heckctor / prepos_install.sh
Last active December 9, 2019 18:36
Script basico que descarga e instala Prepros Linux 5.10.2
#!/bin/bash
# -*- ENCODING: UTF-8 -*-
#Requiere de permisos de ejecución:$chmod -x prepros_install.sh
#Ejecutar como Root: $bash prepros_install.sh
#Validando Acceso Root
if [[ $EUID -ne 0 ]]; then
echo "Tienes que ejecutar este script como Root" 1>&2
exit 1
fi
@carlodaniele
carlodaniele / kinsta-share-users.php
Last active December 11, 2023 15:34
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
@rmpel
rmpel / diacritics-restore.sql
Last active March 13, 2018 16:15
Repair diacritics encoding in MySQL database. Replace table-name and field-name with UTF-8 capable editor (Sublime Text 3 is verified to not mess up the query)
update wp_posts set
post_content = replace(post_content, CONVERT(CAST(CONVERT('¡' USING utf8) AS BINARY) USING latin1), '¡'),
post_content = replace(post_content, CONVERT(CAST(CONVERT('¢' USING utf8) AS BINARY) USING latin1), '¢'),
post_content = replace(post_content, CONVERT(CAST(CONVERT('£' USING utf8) AS BINARY) USING latin1), '£'),
post_content = replace(post_content, CONVERT(CAST(CONVERT('¤' USING utf8) AS BINARY) USING latin1), '¤'),
post_content = replace(post_content, CONVERT(CAST(CONVERT('¥' USING utf8) AS BINARY) USING latin1), '¥'),
post_content = replace(post_content, CONVERT(CAST(CONVERT('¦' USING utf8) AS BINARY) USING latin1), '¦'),
post_content = replace(post_content, CONVERT(CAST(CONVERT('§' USING utf8) AS BINARY) USING latin1), '§'),
post_content = replace(post_content, CONVERT(CAST(CONVERT('¨' USING utf8) AS BINARY) USING latin1), '¨'),
post_content = replace(post_content, CONVERT(CAST(CONVERT('©' USING utf8) AS BINARY) USING latin1), '©'),
@svrist
svrist / cf_create_or_update.py
Created February 7, 2017 21:34
Update or create a CloudFormation stack given a name and template + params'
'Update or create a stack given a name and template + params'
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import logging
import json
import sys
import boto3
import botocore
....
Parameters:
....
CidrBlock:
Default: 172.21.0.0/16
Description: VPC Cidr Block
Type: String
AllowedPattern: "\\d+.\\d+.\\d+.\\d+/\\d+"
ConstraintDescription: Must be CIDR
Subnets:
@dave-malone
dave-malone / cloudformation_s3_serverside_encryption.yml
Created February 6, 2018 03:48
CloudFormation snippet to enable server side encryption by default on an s3 bucket
StaticAssetsS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-encrypted-bucket
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
VersioningConfiguration:
Status: Enabled
@bashtoni
bashtoni / gist:cda204308d9730d6420e59d84f55f77e
Created July 4, 2018 10:49
Get HostedZoneId from AWS CLI for a given domain
aws route53 list-hosted-zones-by-name --dns-name example.com --query HostedZones[].Id --output text | cut -d/ -f3