Skip to content

Instantly share code, notes, and snippets.

View dertin's full-sized avatar

Guillermo Céspedes Tabárez dertin

View GitHub Profile
@dertin
dertin / SecureSessionHandler.php
Last active March 9, 2016 15:57 — forked from eddmann/SecureSessionHandler.php
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;
@dertin
dertin / install.sh
Last active July 4, 2018 00:38
INSTALL LEMP STACK - DEBIAN 8.8
Moved to: https://github.com/dertin/lemp-stack-debian/tree/develop
//https://www.digitalocean.com/community/tutorials/how-to-set-up-xhprof-and-xhgui-for-profiling-php-applications-on-ubuntu-14-04
@dertin
dertin / compressAndBase64Encode.cpp
Last active October 27, 2022 16:01
Compress and Encode with Base64 to a DLL
#include "stdafx.h"
#pragma comment(lib, "ws2_32")
#pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "Cabinet.lib")
#include <Windows.h>
#include <string>
#include <compressapi.h>
#include <wincrypt.h>
@dertin
dertin / xorg.conf
Last active March 4, 2018 22:36
Olidata 20" w2009s - GTX 560 - xUbuntu
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
EndSection
@dertin
dertin / default
Created March 27, 2018 17:12 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@dertin
dertin / deployLocalToEC2.sh
Created April 13, 2018 18:16
Upload the code from a local project to an EC2 instance in Amazon AWS
#!/bin/bash
# Upload the code from a local project to an EC2 instance in Amazon AWS
# It will be necessary to adapt the script to the needs and requirements of your project
# Use at your own risk
# Configuration
readonly DEPLOY_NAME=DeployTesting
readonly DEPLOY_SOURCE=~/Projects/testing
readonly KEY_PAIRS=~/.ssh/keypairs.pem
@dertin
dertin / makeswapfile.sh
Last active April 19, 2018 15:32
Create swap file on AWS EC2 t2.micro 1gb
#!/bin/bash
sudo dd if=/dev/zero of=/swap bs=1M count=1024
sudo mkswap /swap
sudo chmod 600 /swap
sudo swapon /swap
sudo cp -iv /etc/fstab{,-$(date '+%y%m%d%H%M%S').bak}
sudo nano /etc/fstab
# add line
@dertin
dertin / fstab
Last active June 20, 2022 09:15
AWS EC2 t2.micro / t2.small
# /etc/fstab
UUID=XXXXXXXXXXX / ext4 noatime,nodelalloc,barrier=0,i_version,commit=30,inode_readahead_blks=64,rw,errors=remount-ro 0 1
@dertin
dertin / Hadoop-3.1.md
Last active February 18, 2024 15:37 — forked from xterat/Compile-Hadoop-2.8.md
Hadoop 3.1 on Debian 9.5

INSTALL Hadoop 3.1 on Debian 9.5

  1. Install some dependencies:
   su -
   apt -y install build-essential autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev libsasl2-dev \
   libsnappy-dev bzip2 libbz2-dev libjansson-dev fuse libfuse-dev zstd \
   clang libc6-dev libtool libzip-dev libncurses-dev liblzo2-dev  \
 software-properties-common dirmngr python python-dev python-setuptools \