Skip to content

Instantly share code, notes, and snippets.

View asta-kun's full-sized avatar
⛩️
Working from home

Héctor Castillo asta-kun

⛩️
Working from home
View GitHub Profile
@granoeste
granoeste / EachDirectoryPath.md
Last active June 19, 2024 07:37
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@laszlomiklosik
laszlomiklosik / gist:9661756
Last active May 24, 2022 09:22
Allow remote access to postgres via username and password
1) in file /var/lib/pgsql/9.3/data/postgresql.conf change the default value 'localhost' to '*' (all) as shown
listen_addresses = '*'
2) in file /var/lib/pgsql/9.3/data/pg_hba.conf add line:
host all all all password
3) if it still does not work, you bet it's iptables fault. so either stop it temporarily to verify this or add an exception for port 5432
@tobywf
tobywf / clean_old_lambda_versions.py
Last active June 10, 2024 14:15
A quick script to remove old AWS Lambda function versions
from __future__ import absolute_import, print_function, unicode_literals
import boto3
def clean_old_lambda_versions():
client = boto3.client('lambda')
functions = client.list_functions()['Functions']
for function in functions:
versions = client.list_versions_by_function(FunctionName=function['FunctionArn'])['Versions']
for version in versions: