Skip to content

Instantly share code, notes, and snippets.

View dcalixto's full-sized avatar
🎯
Focusing

Daniel dcalixto

🎯
Focusing
View GitHub Profile
@dcalixto
dcalixto / ubuntu14.04-command-line-install-android-sdk
Created November 16, 2017 20:15 — forked from shark0der/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk (platform & platform-tools only, no emulator)
# install java
apt-get install -y software-properties-common
apt-add-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
# download latest android sdk
# http://developer.android.com/sdk/index.html#Other
cd /opt
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
@dcalixto
dcalixto / react-native-setup-linux.md
Created November 13, 2017 19:23 — forked from andrei-cacio/react-native-setup-linux.md
React native setup on Ubuntu/Linux

Guide for installing React Native on Linux (ubuntu 14.04)

Step 1: Install JDK 7

sudo apt-get install openjdk-7-jdk

Step 2: Download the Android SDK

@dcalixto
dcalixto / sugar-vs-fat.md
Created October 29, 2017 22:02 — forked from diegoeis/sugar-vs-fat.md
Anotações sobre o documentário Sugar vs Fat

Sugar VS Fat (Netflix)

  • açúcar não é apenas aquele pó branco, mas pão, frutas, farinha branca se transformam em açúcar no sangue
  • quem faz a dieta baseada em proteína/gordura não faz muito coco
  • Gordura saturada eleva o colesterol, bloqueia as artérias
  • muito açúcar no sangue libera insulina, que é um hormônio que regula o açúcar no sangue. comer muito açúcar pode nos fazer engordar.
  • muito açúcar pode nos levar a diabetes
  • Exames de colesterol e insulina são bons pra entender seu estado físico
  • Testes de massa muscular e gordura é importante pra saber a porcentagem de gordura e músculo no corpo, composição corporal
  • glicose é o melhor é o principal combustível do cérebro
@dcalixto
dcalixto / android_instructions.md
Created July 10, 2017 16:57 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@dcalixto
dcalixto / application_controller.rb
Last active March 6, 2017 01:44 — forked from fred/application_controller.rb
Adding Opensearch to my Rails 3.2 app
#app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
def opensearch
response.headers['Content-Type'] = 'application/opensearchdescription+xml; charset=utf-8'
end
@dcalixto
dcalixto / nginx-tuning.md
Created February 11, 2017 14:06 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@dcalixto
dcalixto / deploy.rb
Created February 11, 2017 01:39
private_pub capistrano tasks
namespace :private_pub do
desc "Start private_pub server"
task :start do
run "cd #{current_path};RAILS_ENV=production bundle exec rackup private_pub.ru -s thin -E production -D -P tmp/pids/private_pub.pid"
end
desc "Stop private_pub server"
task :stop do
run "cd #{current_path};if [ -f tmp/pids/private_pub.pid ] && [ -e /proc/$(cat tmp/pids/private_pub.pid) ]; then kill -9 `cat tmp/pids/private_pub.pid`; fi"
end
@dcalixto
dcalixto / fine tune ubuntu 14
Created February 4, 2017 07:40
fine tune ubuntu 14
How to Performance Tune Ubuntu 14.04 LTS Trusty in AWS EC2
October 28, 2015
This article will explain how to performance tune Ubuntu 14.04 LTS Trusty in Amazon Web Services EC2. Building a good base AWS AMI is important and if your using Ubuntu 14.04 this will hopefully be of some help.
Step 0
Time Matters! Make sure you have NTP installed otherwise do the following:
sudo apt-get update
~/Downloads$ sudo rm /etc/apt/sources.list.d/upubuntu-com-ppa-trusty*
rm: cannot remove ‘/etc/apt/sources.list.d/upubuntu-com-ppa-trusty*’: No such file or directory
smartron@Ubuntu1:~/Downloads$ cd /etc/apt/sources.list.d
smartron@Ubuntu1:/etc/apt/sources.list.d$ ls -la
-rw-r--r-- 1 root root 150 Jul 18 22:06 openshot_developers-ppa-trusty.list
-rw-r--r-- 1 root root 150 Jul 18 22:06 openshot_developers-ppa-trusty.list.save
smartron@Ubuntu1:/etc/apt/sources.list.d$ sudo rm openshot_developers-ppa-trusty.list
smartron@Ubuntu1:/etc/apt/sources.list.d$ sudo rm openshot_developers-ppa-trusty.list.save
sudo apt-get update (results look good to me - no errors)
sudo apt-get remove gdal-bin
Introduction
There is nothing quite like reading your (ssh) logs to instil a healthy dose of paranoia. While ssh is a powerful tool, it is a common target for "script kiddies" .
In this tutorial I will show you several methods to help increase the security of your ssh server. My preference is to start with tools already available with a default installation and I personally tend to avoid additional services, such as denyhosts or fail2ban.
I advise you start with proper configuration of the ssh server (sshd_config) and next take a look at ssh key authentication, TCPWrapper, and use of a firewall.
I will cover additional services (denyhosts/fail2ban) last.