Skip to content

Instantly share code, notes, and snippets.

View jaircuevajunior's full-sized avatar
:octocat:
Hello there!

Jair Cueva Júnior jaircuevajunior

:octocat:
Hello there!
View GitHub Profile
sudo add-apt-repository ppa:thefrontiergroup/vsftpd
sudo apt-get update
sudo apt-get install vsftpd
sudo vi /etc/vsftpd.conf

local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
@jaircuevajunior
jaircuevajunior / apache_httpd_compile.txt
Last active August 29, 2015 14:24
Compilling Apache From Source
apt-get build-dep apache2
#apt-get install build-essential checkinstall libapr1-dev libaprutil1-dev bison flex
wget http://www.us.apache.org/dist/httpd/httpd-2.4.16.tar.gz
tar -xzvf httpd-2.4.16.tar.gz
cd httpd-2.4.16/
./configure --prefix=/usr/local/httpd-2.4.16
make
make install
@jaircuevajunior
jaircuevajunior / php_compile.txt
Last active October 7, 2015 00:06
Compilling PHP From Source
apt-get install libpng-dev zlib-bin libjpeg-dev libmcrypt-dev
cd source-folder...
make clean
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/http/bin/apxs \
--with-gd \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-jpeg-dir \
@jaircuevajunior
jaircuevajunior / apache_ssl_secure.txt
Last active March 3, 2016 20:12
Secure SSL Enable Apache
Editar o arquivo /etc/apache2/mods-available/ssl.conf
Comentar e adicionar as linhas: SSLCipherSuite e SSLProtocol
Editar o arquivo do vhost em questão
SSLEngine on
SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1
SSLCompression off
SSLHonorCipherOrder On
SSLCipherSuite "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA"
Header always set Strict-Transport-Security "max-age=63072000;"
openssl req -new -newkey rsa:2048 -nodes -keyout example.key -out example.csr
@jaircuevajunior
jaircuevajunior / jailkit.txt
Last active September 30, 2015 18:18
Jailkit Chroot SSH User Ubuntu
http://www.binarytides.com/setup-jailed-shell-jailkit-ubuntu/
PHP
vi /etc/jailkit/jk_init.ini
[php]
comment = the php interpreter and libraries
executables = /usr/bin/php5
directories = /usr/lib/php5, /usr/share/php, /usr/share/php5, /etc/php5, /usr/share/php-geshi, [B]/usr/share/zoneinfo[/B]
includesections = env
@jaircuevajunior
jaircuevajunior / LAMP_Ubuntu16.md
Last active May 5, 2017 03:35
compile PHP with extensions

apt-get install libbz2-dev libjpeg-dev libpng-dev libfreetype6-dev libmcrypt-dev libxslt-dev

./configure --enable-fpm --enable-pdo --with-pdo-mysql --enable-sockets --enable-exif --enable-ftp --enable-wddx --enable-pcntl --enable-soap --enable-bcmath --enable-mbstring --enable-dba --enable-gd-native-ttf --enable-zip --enable-calendar --with-mysqli --with-pdo-sqlite --with-iconv --with-zlib --with-bz2 --with-gettext --with-xmlrpc --with-openssl --with-curl --with-mhash --with-mcrypt --with-xsl --with-pcre-regex --with-gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-ldap --with-pear --with-fpm-user=www-data --with-fpm-group=www-data --with-config-file-path=/etc/php/ --with-libdir=lib/x86_64-linux-gnu

@jaircuevajunior
jaircuevajunior / compile_mysql.md
Last active April 7, 2024 12:42
Compile MySQL 5.7 from source
  1. Download build-tools
apt-get install build-essential cmake -y
  1. Configure the compiler
cmake \
-DWITH_BOOST=/usr/local/src/mysql-5.7.19/boost/boost_1_59_0 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql57 \
@jaircuevajunior
jaircuevajunior / elastic_search.md
Last active October 27, 2017 21:17
Install Elastic Search With Auth
@jaircuevajunior
jaircuevajunior / shrink_xenserver_vm_disk.md
Last active January 22, 2023 10:20
Shrinking XenServer VDI VM Disk

Shrinking XenServer VDI VM Disk

XenServer doesn't allow us to do this kinda shrinking so we better recreate the vm copying all the files and recreating grub (boot) files.

1. Prepare the new disk

  • Create a Virtual Disk with the final desired size (eg our running vm disk has currently 100G and we want to shrinkg it to 80G so this new disk is gonna be 80G)
  • Attach the new disk to the running VM. (For this we'll need to shutdown the vm for a brief moment and power up it back again)
  • Under the VM terminal we format the new disk:
fdisk /dev/xvdb #(n, p, ...) DON'T FORGET TO CREATE THE SWAPP PARTITION!!!
mkfs.ext4 /dev/xvdb1