Skip to content

Instantly share code, notes, and snippets.

View fernandoaleman's full-sized avatar

Fernando Aleman fernandoaleman

View GitHub Profile
@fernandoaleman
fernandoaleman / gist:4551494
Created January 16, 2013 22:21
How to recursively delete Amazon S3 zero byte files from buckets
s3cmd ls --recursive s3://BUCKET_NAME | ruby -rdate -ne 'date, time, size, uri = $_.split; puts uri if size == "0"' | xargs s3cmd del
@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@fernandoaleman
fernandoaleman / rbenv-1.8.7-openssl.patch
Created June 5, 2014 20:41
Patch to solve error when installing ruby 1.8.7 with rbenv or ruby_build and openssl 1.0.1x
--- ext/openssl/ossl_pkey_ec.c
+++ ext/openssl/ossl_pkey_ec.c
@@ -757,8 +757,10 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
method = EC_GFp_mont_method();
} else if (id == s_GFp_nist) {
method = EC_GFp_nist_method();
+#if !defined(OPENSSl_NO_EC2M)
} else if (id == s_GF2m_simple) {
method = EC_GF2m_simple_method();
+#endif
@fernandoaleman
fernandoaleman / rbenv-openssl.patch
Created June 17, 2014 15:47
Patch to solve error when installing ruby 1.8.7 or 1.9.2 with rbenv or ruby_build and openssl 1.0.1x
--- ext/openssl/ossl_pkey_ec.c
+++ ext/openssl/ossl_pkey_ec.c
@@ -757,8 +757,10 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
method = EC_GFp_mont_method();
} else if (id == s_GFp_nist) {
method = EC_GFp_nist_method();
+#if !defined(OPENSSl_NO_EC2M)
} else if (id == s_GF2m_simple) {
method = EC_GF2m_simple_method();
+#endif
@fernandoaleman
fernandoaleman / how-to-install-vsftpd-on-centos.txt
Created June 27, 2014 13:57
How To Install vsftpd on CentOS 6
Installing vsftpd on CentOS
yum install vsftpd
How to configure vsftpd:
Now that you’ve installed vsftpd, follow this procedure to configure it. These steps applies for both the linux variants.
Before you get started, stop the vsftpd by typing:
@fernandoaleman
fernandoaleman / how-to-resize-amazon-ebs-drive
Created June 27, 2014 17:32
How to resize Amazon EBS drive
# Check the name of the volume
fdisk -l
# Should look like this:
# Disk /dev/xvde: 214.7 GB, 214748364800 bytes
# Resize the volume
resize2fs /dev/xvde
@fernandoaleman
fernandoaleman / converting-mysql-database-contents-to-utf8
Created August 14, 2014 20:08
Converting MySQL Database Contents to UTF-8
# First create a dump of your MySQL database
mysqldump -u [user] -p database_name > database_name.sql
# Convert the data
iconv -f iso-8859-15 -t utf8 database_name.sql > database_name_iconv.sql
# Import the database
mysql -u [user] -p database_name < database_name_iconv.sql
# If you still have some specific characters that do not display
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

@fernandoaleman
fernandoaleman / INSTALL.txt
Last active April 14, 2021 09:54
Shell script to sync remote branches from upstream and push them up to forked origin
1. Copy 'git-sync-fork' script code from gist
2. Create a file called 'git-sync-fork' in any 'bin' directory in your $PATH
3. Paste script into this new file 'git-sync-fork' and save
4. Make the file executable `chmod +x git-sync-fork`
5. Run the script inside your locally forked git repo
Example:
git-sync-fork upstream origin