Skip to content

Instantly share code, notes, and snippets.

@tahmidsadik
tahmidsadik / purgeAndroid.txt
Created September 19, 2015 18:47
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
@pablitoc
pablitoc / configure_proxy_protocol.md
Last active April 12, 2023 15:21
Configuring Proxy Protocol

##Install AWS CLI Tools##

  1. Install AWS CLI Tools. You can also use the EC2 API Tool if you are more comfortable with them. But this write-up uses the EC2 CLI.
  2. Create a user via Amazon IAM or download the security accessID and securitykey you will need it to query Amazon CLI.
  3. using Terminal cd into .aws directory cd ~/.aws edit or create new file named config paste the following contents inside.
    `[default]`
    `aws_access_key_id = ACCESS_ID`
    `aws_secret_access_key = SECRET_ID`
    `output = json OR bson OR text`
    `region = PREFERRED_AWS_REGION`

Save the file as "config"

@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active December 1, 2023 04:55
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active June 11, 2024 13:23
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@timusg
timusg / keepalived-eip-switch.erb.sh
Last active October 20, 2016 21:01
keepalived notification script for switch elastic ip, helpful to setup highly available haproxy in ec2/VPC
#!/bin/bash
export EC2_HOME=/usr/local/share/ec2_tools/
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:$EC2_HOME/bin
INSTANCEID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
case "$1" in
MASTER)
logger triggering notify master event
@crazed
crazed / gist:7670423
Last active September 7, 2023 22:20
getting a moto x back to stock on mac os x
  1. grab the moto-fastboot version of fastboot here

  2. grab the appropriate stock firmware here (tip: you want the one that matches your android build number in settings -> about phone)

  3. unzip this file somewhere and make it easy to run the moto-fastboot-osx64 command from step 1

  4. get your phone into fastboot mode, google it if needed but just power the phone off, hold the down volume key and power button for 3 seconds then let go, should get you there

  5. verify you are ready for flashing:

     ./moto-fastboot-osx64 devices
     -- should list a device --
    
  6. most of the time you just need to flash system and recovery images, so from your unzipped stock firmware files do this:

@plentz
plentz / nginx.conf
Last active July 27, 2024 16:11
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ricardoalcocer
ricardoalcocer / csv2json.php
Created April 23, 2013 22:25
Quick and dirty proof-of-concept of uploading a flat CSV file onto a server and getting in return a JSON feed for that data. This is part of an idea I have for an online service that just does this.
<?php
// ****
// Inspired by: https://gist.github.com/robflaherty/1185299
class csv2json {
private static function csvToArray($file, $delimiter) {
if (($handle = fopen($file, 'r')) !== FALSE) {
$i = 0;
while (($lineArray = fgetcsv($handle, 4000, $delimiter, '"')) !== FALSE) {
for ($j = 0; $j < count($lineArray); $j++) {
$arr[$i][$j] = $lineArray[$j];
<Alloy>
<TabGroup>
<Tab title="tab 1">
<Window title="tab 1"/>
</Tab>
<Tab title="tab 2">
<Window title="tab 2"/>
</Tab>
</TabGroup>
</Alloy>
@daFish
daFish / ScriptHandler.php
Created November 13, 2012 13:00
Run 'bower install' with composer
namespace Fmdb\CoreBundle\Composer;
use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler as BaseScriptHandler;
use Symfony\Component\ClassLoader\ClassCollectionLoader;
use Symfony\Component\Process\Process;
class ScriptHandler extends BaseScriptHandler
{
public static function installBowerAssets($event)
{