Skip to content

Instantly share code, notes, and snippets.

View PauloLuan's full-sized avatar
💭
Ora et labora

Paulo Luan PauloLuan

💭
Ora et labora
View GitHub Profile
package br.inova.mobile.rest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
@PauloLuan
PauloLuan / GetExternalSdCardPath.java
Last active October 31, 2022 07:02
how to get the external sd card path on android.
public static String getExternalSdCardPath() {
String path = null;
File sdCardFile = null;
List<String> sdCardPossiblePath = Arrays.asList("external_sd", "ext_sd", "external", "extSdCard");
for (String sdPath : sdCardPossiblePath) {
File file = new File("/mnt/", sdPath);
if (file.isDirectory() && file.canWrite()) {
@PauloLuan
PauloLuan / crawler_data_sus.py
Created August 12, 2014 17:20
Crawler data sus
# -*- coding: utf-8 -*-
# Copyleft 2014 Paulo Luan <https://github.com/transparenciasjc>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@PauloLuan
PauloLuan / .bashrc
Last active August 29, 2015 14:06
Bashrc Backup
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@PauloLuan
PauloLuan / Squid
Created October 31, 2014 12:48
Configurando monitoramento de URL's no squid
squid:
adicionar: 'strip_query_terms off' em /etc/squid3/squid.conf
sudo grep -n 'strip_query_terms' /etc/squid3/squid.conf
sudo service squid3 restart # re-inicializa
sudo tail -f /var/log/squid3/access.log # monitora
Pegar o resultado e extrair as urls em: http://www.toolsvoid.com/extract-domains
@PauloLuan
PauloLuan / Parar Processo da porta 80
Last active June 21, 2021 17:54
Parar Processo da porta 80
sudo kill -9 $(sudo lsof -t -i:8080)
@PauloLuan
PauloLuan / nodejs_production
Last active August 29, 2015 14:11
NODEJS production mode
sudo su
# update system
apt-get update && apt-get upgrade -y
# download and configure Node Version Manager
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.20.0/install.sh | bash && \
source /root/.nvm/nvm.sh && \
nvm install stable && nvm use stable && nvm alias default stable && \
node -v
@PauloLuan
PauloLuan / instalar-java7
Created December 11, 2014 17:03
Instalar Oracle Java7
sed 's/main$/main universe/' -i /etc/apt/sources.list
apt-get update && apt-get install -y software-properties-common python-software-properties
add-apt-repository ppa:webupd8team/java -y
apt-get update
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
apt-get install -y oracle-java7-installer
https://gitlab.com/PauloLuan/bauru-sac-admin.git
[email protected]:PauloLuan/bauru-sac-admin.git
https://gitlab.com/PauloLuan/bauru-sac.git
[email protected]:PauloLuan/bauru-sac.git
cd C:
@PauloLuan
PauloLuan / cors_jquery
Created May 4, 2015 17:54
Activate COR's on Jquery requests
var module = (function () {
// private variables and functions
var foo = 'bar';
// constructor
var module = function () {
configureCorsFilter();
};
var configureCorsFilter = function(){