Skip to content

Instantly share code, notes, and snippets.

View bryanisimo's full-sized avatar

Bryan González Alcíbar bryanisimo

View GitHub Profile
@bryanisimo
bryanisimo / development-setup-el-capitan
Last active September 26, 2024 02:52
Installing NGINX+PHP+MYSQL+DNSMASQ in OSX "El Capitan"
#!bash
# Removing apache from autostart
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
brew tap homebrew/services
# Installing NGINX
brew install nginx
# Adding NGINX to autostart
ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
@bryanisimo
bryanisimo / no-active-boder.css
Created May 25, 2017 16:52
Removing on focus active border
a:focus,
a:active,
button:focus,
button:active,
div:focus,
div:active,
select:focus,
select:active,
video:focus,
video:active
@bryanisimo
bryanisimo / php72_installation.sh
Last active March 7, 2018 02:25
unlock repositories in RHEL PHP, Redhat "Security"
# Reenabling blocked repos
vim /etc/yum/pluginconf.d/search-disabled-repos.conf
# set notify_only to zero
# notify_only=0
# So now you can install all the dependencies for laravel
yum --enablerepo=remi,remi-php72 install php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongodb php-pecl-memcache php-pecl-memcached
yum --enablerepo=remi,remi-php72 install php-gd php-mbstring php-mcrypt php-xml php-pecl-imagick
yum --enablerepo=remi,remi-php72 install php-pecl-zip
@bryanisimo
bryanisimo / creating-user.sh
Last active December 24, 2019 09:29
Medium - Creating passwordless user and adding it to www-data group
# Creating passwordless user
sudo adduser --home '/home/bry' --disabled-login --gecos 'Bryan' bry
# Making user's default group www-data
sudo usermod -g www-data bry
# We shoud generate a deploy key
sudo su - bry
ssh-keygen -t rsa -b 4096 -C "bry@server"
cat .ssh/id_rsa.pub
@bryanisimo
bryanisimo / locales-utf8.sh
Created March 24, 2018 20:04
Locales UTF-8 - Fixing Debian Problem
# Setting locales with root user
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
localedef -i en_US -f UTF-8 en_US.UTF-8
dpkg-reconfigure locales
@bryanisimo
bryanisimo / sshd
Last active April 2, 2018 18:58
sshd configurations
Ciphers aes128-ctr,aes192-ctr,aes256-ctr
HostKeyAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256
MACs hmac-sha2-256,hmac-sha2-512,hmac-sha1
LogLevel VERBOSE
AuthorizedKeysFile /etc/ssh/authorized-keys/%u
PermitRootLogin prohibit-password
@bryanisimo
bryanisimo / postfix-tables.sql
Last active March 25, 2018 08:40
Creating tables for postfix
CREATE TABLE `users` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`active` tinyint(1) NOT NULL,
`email` varchar(255) NOT NULL DEFAULT '',
`pwd` varchar(255) NOT NULL DEFAULT '',
`quota` INT(10) DEFAULT '10485760',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@bryanisimo
bryanisimo / create-web-user.py
Last active May 16, 2018 22:15
Creating www-data users in Linux # Python 2.7
import os
import pwd
import subprocess
import argparse
def demote(user_uid, user_gid):
def result():
report_ids('starting demotion')
os.setgid(user_gid)
@bryanisimo
bryanisimo / test.java
Last active October 15, 2019 17:58
Ejemplo.java
public static void main(){
String str = (12345).toString();
String[] arrOfStr = str.split("");
String result = "";
for (String a : arrOfStr) {
String temp = Math.pow(parseInt(a), 5).toString;
result = result.concat( temp );
}
system.out.println( result );
# Update Server
sudo apt-get update && sudo apt-get upgrade -y
# Universe + Fira Font
sudo add-apt-repository universe
sudo apt install fonts-firacode -y
# Tools
sudo apt-get install curl wget vim gdebi-core zsh git-core fontconfig -y
# Setting Vim as default editor
sudo update-alternatives --config editor