Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Pablo Serrano pserrano

🏠
Working from home
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am pserrano on github.
  • I am pserrano (https://keybase.io/pserrano) on keybase.
  • I have a public key ASAKSE_1tOOTC2BUStfG3jAMp5r75NTaGO6_cBpWya_saQo

To claim this, I am signing this object:

@pserrano
pserrano / server.json
Created Nov 14, 2018
Packer with ansible solution for AWS
View server.json
"variables": {
"profile": "aws1",
"region": "eu-east-1",
"type":"amazon-ebs",
"ssh_keypair_name": "private",
"ssh_private_key_file": "$HOME/.ssh/private.pem"
},
"provisioners": [
{
@pserrano
pserrano / hosts_ansible_vagrant
Last active Jan 15, 2018
Ssh into a vagrant machine with ansible
View hosts_ansible_vagrant
#search ssh file key of machine with 'vagrant ssh-config | grep IdentityFile'
192.168.50.5 ansible_ssh_port=22 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.ssh/id_rsa
View gist:99968d26eed4a492d1c0e3cd40be3c0b
#To start using your cluster, you need to run (as a regular user):
sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf
@pserrano
pserrano / gitreset
Created Sep 14, 2017
Remove commit and revert
View gitreset
git reset --hard <commit-hash>
git push -f origin master
View gitsuperpull.sh
#!/bin/bash
DIRS=($(ls -d */))
PWD=($(pwd))
GIT="/.git/"
for i in "${DIRS[@]}"; do
if [[ "$i" == "parameters/" ]] || [[ "$i" == "jenkinsfile/" ]]; then
cd $i; PARA=($(ls -d */));
echo $i
for j in "${PARA[@]}"; do
echo $j
@pserrano
pserrano / php_append.php
Created Sep 9, 2016
php_append.php auto_append_file fpm memory check process
View php_append.php
#Memory check process for fpm
<?php
$logline = sprintf(date("Y-m-d H:i:s") . "\t" . round(memory_get_peak_usage() / 1024 / 1024,2) . " MB\t" . $_SERVER["REQUEST_URI"] . "\n");
file_put_contents("/var/log/nginx/fpm_memory.log", $logline, FILE_APPEND | LOCK_EX);
@pserrano
pserrano / yosemite ntfs read+write.txt
Last active Oct 17, 2015 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
View yosemite ntfs read+write.txt
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
View gist:2a919f248bf74fe31972
LINT_IGNORES = ['rvm']
namespace :lint do
desc "Check puppet module code style."
task :ci do
begin
require 'puppet-lint'
rescue LoadError
fail 'Cannot load puppet-lint, did you install it?'
end
@pserrano
pserrano / backup.php
Last active Aug 29, 2015 — forked from Serhioromano/backup.php
Backup EC2 EBS automatic snapshot for all volumes if you want backup for all.
View backup.php
#!/usr/bin/php -q
<?php
date_default_timezone_set('UCT');
$dryrun = FALSE;
$interval = '24 hours';
$keep_for = '10 Days';
$volumes = array('vol-********');
$api_key = 'AKIAIXXXXXXXXXXXXXXX';
$api_secret = 'IzMni.........................emQKct';
You can’t perform that action at this time.