Skip to content

Instantly share code, notes, and snippets.

View FernandoMiguel's full-sized avatar

Fernando Miguel FernandoMiguel

View GitHub Profile
@lombax85
lombax85 / gist:e25d331c063da83c5060693cada1a54f
Created April 15, 2021 09:14
Powernap on M1 and Big Sur
# check wake requests
pmset -g log | grep "Wake Requests"
# check wake logs
pmset -g log | grep darkwake
# statistics
pmset -g stats
# check if powernap is enabled
@kquinsland
kquinsland / dummy0.netdev
Created December 3, 2019 02:54
How to get consul-agent and systemd.resolvd to co-exist peicefully and still be able to resolve *.consul hostsnames from within docker
# Creates a "dummy" network interface
# we'll configure this interface with a link-local address
# See: https://www.freedesktop.org/software/systemd/man/systemd.netdev.html
##
[NetDev]
Name=dummy0
Kind=dummy
@lox
lox / README.md
Last active November 12, 2018 15:02
Troubleshooting Performance Issues with M5.large Instances

Overview

We have an autoscaling group of m5.large instances with 250GB EBS root volumes that we use for running our Buildkite test suites. This group scales up from 0 to 40 during the work day and then down again, so each day we see new instances.

We've been seeing every few days that a few of the instances run very, very slowly. Our test suite either takes 100x it's usual time or times out entirely. On the host machine, a basic command like aws s3api head-object --bucket blah --key blah will take 45 seconds.

All instances are m5.large in us-east-1 running the latest Amazon Linux 2 ami-06631de3819cb42f3

Tests

@ColinLeverger
ColinLeverger / update-images.sh
Created December 8, 2016 11:36
Update all Docker images
docker images | grep -v REPOSITORY | awk '{print $1}' | xargs -L1 docker pull
@tomdavidson
tomdavidson / example-aws-assume-role-wrapper.sh
Created June 17, 2016 19:40
wrapper scirpt that assumes aws role
#! /usr/bin/env bash
# Wrapper scirpt that assumes aws role and then runs your script that needs the creds.
# Im not remembering where I got it, but it was at least inspired by another if not verbarium.
account_id=$1
role=$2
CMD="$@"
ACCOUNT_ID=11111111111
@melo
melo / aws.md
Last active April 20, 2017 04:15
AWS ElasticBeanstalk inconsistency...

** found it ** - I was running an old version of AWS CLI :)

I was able to create a ElasticBeanstalk environment with a EnvironmentName that is longer than what the API's allows...

I can describe the environment, but I can't find the options for it, describe-configuration-options doesn't accept --environment-id... :(

$ env_name=`aws elasticbeanstalk describe-environments --environment-id e-XXXXXXXX | jq .Environments[0].EnvironmentName`
$ echo $env_name
"XXXXXXXX-XXXXXXX-XXX-XXX"

$ aws elasticbeanstalk describe-environments --environment-name $env_name

@grcninja
grcninja / twitter-block-user.py
Last active October 11, 2021 14:48 — forked from 00101010b/twitter-block-user.py
Simple script to block annoying twitter spammers. Requires twitter API codes.
#!/usr/bin/env python
#Python3.4.3 compatable
#All the credit for this goes to the original author 00101010b.
#I just added a for loop and list of possible account names.
# Import TwitterAPI
# you can install this library via the commandline:
# $ pip install --user TwitterAPI
from TwitterAPI import TwitterAPI
@leommoore
leommoore / ssl_basics.md
Last active May 9, 2018 16:39
SSL Basics

#SSL Basics

Secure Socket Layer (SSL) is a mechanism to allow information to be securely communicated. Specifically, it is a cryptographic protocol that enables two parties such as a web server and a browser to exchange information securely by encrypting it before sending and decrypting it upon receipt. It is based on the X.509 standards.

##Symmetric and Asymmetric Encryption Encrypting and decrypting requires a secret like a password, which is known as a key. There are two types of key, symmetric and asymmetric. If a symmetric key is used it means that the same key is used to encrypt and decrypt the message. Asymmetric keys consist of a private and public key. The message sender encrypts the message using their private (secret) key and the message receiver can decrypt the message using the senders public key.

Asymmetric keys require more processing resources than symmetric keys. The problem is that to communicate using symmetric keys both parties have to have the symmetric keys first and the question is

# Basic Strongswan ikev2 server setup
* paltform: atlantic.net ubuntu 14.04 x64
* the commands below are run with root account
## Strongswan
```
apt-get install strongswan
apt-get install iptables iptables-persistent
```
@phedoreanu
phedoreanu / apache ssh keys
Last active January 25, 2024 17:34
git PHP webhook
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R apache:apache /var/www/.ssh
sudo -u apache ssh-keygen (empty passphrase)
paste public key into repo manager
(git-repo) sudo -u apache git pull origin branch (this will create /var/www/.ssh/known_hosts)
call git_hook.php?branch=xxx