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 / enhance-vim.sh
Last active August 19, 2020 02:51
Enhancing VIM in one line
# VIM with esteroids in one line (https://github.com/amix/vimrc)
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime && sh ~/.vim_runtime/install_awesome_vimrc.sh
<li>
<a style="background-image: url('/blog/wp-content/uploads/2019/04/NY.png');" target="_blank"
href="http://www.skyscanner.com.mx/transporte/vuelos/mex/nyca/vuelos-baratos-de-ciudad-de-mexico-a-nueva-york.html?adults=1&amp;children=0&amp;infants=0&amp;cabinclass=economy&amp;rtn=1&amp;preferdirects=false&amp;outboundaltsenabled=false&amp;inboundaltsenabled=false&amp;selectedoday=01&amp;oym=1608&amp;iym=1609&amp;selectediday=01">
<strong>Ciudad de México a NEW YORK</strong>
</a>
</li>
<li>
<a style="background-image: url('/blog/wp-content/uploads/2019/04/NY.png');" target="_blank"
href="http://www.skyscanner.com.mx/transporte/vuelos/mex/nyca/vuelos-baratos-de-ciudad-de-mexico-a-nueva-york.html?adults=1&amp;children=0&amp;infants=0&amp;cabinclass=economy&amp;rtn=1&amp;preferdirects=false&amp;outboundaltsenabled=false&amp;inboundaltsenabled=false&amp;selectedoday=01&amp;oym=1608&amp;iym=1609&amp;selectediday=01">
<strong>Ciudad de México a NEW YORK</strong>
sudo apt-get update && sudo apt-get install mysql-server -y
sudo mysql_secure_installation
# Switching authentication method from auth_socket to mysql_native_password
sudo mysql
MYSQL> SELECT user,authentication_string,plugin,host FROM mysql.user;
MYSQL> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
MYSQL> FLUSH PRIVILEGES;
MYSQL> SELECT user,authentication_string,plugin,host FROM mysql.user;
MYSQL> exit
sudo apt-get update
sudo apt install gnupg2 wget ca-certificates -y
sudo apt install wget software-properties-common apt-transport-https -y
# PHP 7.4 + Composer
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.4 php7.4-fpm php7.4-cli php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath php7.4-bz2 php7.4-imagick php7.4-mcrypt php7.4-opcache php7.4-sqlite3 php7.4-ssh2 php7.4-uploadprogress php7.4-uuid -y
# 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
@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 );
@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 / 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 / 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 / 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