Skip to content

Instantly share code, notes, and snippets.

View dansku's full-sized avatar
🌮
Focusing on tacos

Daniel Andrade dansku

🌮
Focusing on tacos
View GitHub Profile
@dansku
dansku / main.py
Created May 1, 2022 01:57
aula 01
import test
print("OLA GATINHO")
@dansku
dansku / etl_backups.sh
Last active August 8, 2021 11:01
etl snapshot script.
#!/bin/bash
# Variables
ETL_DIR=/root/blockchain-etl
ETL_USER=etl
ETL_DB=etl
ETL_PASS=etl
EXPORT_CORES=32
PSQL_HOST=localhost
EXPORT_DIR=/root/export
@dansku
dansku / dropboxOrganize.py
Created February 16, 2014 20:32
Script to organize pictures uploaded from Mobile Devices to Dropbox's Camera Upload folder
################################################################################################
#
# Script to organize pictures uploaded from Mobile Devices to Dropbox's Camera Upload folder
#
# Daniel Spillere Andrade - www.danielandrade.net
#
################################################################################################
import os, time
import glob
@dansku
dansku / minerChecker.sh
Created September 14, 2020 15:30
helium gatewau height checker
while true; do
miner01=$(docker exec miner001 miner info height | awk '{print $2}')
miner02=$(docker exec miner002 miner info height | awk '{print $2}')
miner03=$(docker exec miner003 miner info height | awk '{print $2}')
folder01=$(du -hs minerdata001 | awk '{print $1}')
folder02=$(du -hs minerdata002 | awk '{print $1}')
folder03=$(du -hs minerdata003 | awk '{print $1}')
/*
Daniel Andrade - www.danielandrade.net
non blocking classes for NewPing sonars
*/
#include <NewPing.h>
class Sonar : public NewPing
{
// Class Member Variables
@dansku
dansku / geo-distance.py
Created May 31, 2013 01:23
Measuring distance from two Geo-Points in Python
import math
def distance(lat1, long1, lat2, long2):
R = 6371 # Earth Radius in Km
dLat = math.radians(lat2 - lat1) # Convert Degrees 2 Radians
dLong = math.radians(long2 - long1)
lat1 = math.radians(lat1)
lat2 = math.radians(lat2)
a = math.sin(dLat/2) * math.sin(dLat/2) + math.sin(dLong/2) * math.sin(dLong/2) * math.cos(lat1) * math.cos(lat2)
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))
@dansku
dansku / avengers_watch_order.md
Last active July 9, 2019 08:53
avengers_watch_order

Downloaded

  1. Captain America: The First Avenger (2011)
  2. Captain Marvel (2019)
  3. Iron Man (2008)
  4. Iron Man 2 (2010)
  5. The Incredible Hulk (2008)
  6. Thor (2011)
  7. The Avengers (2012)
  8. Thor: The Dark World (2013)
@dansku
dansku / ender3_profile.ini
Created April 15, 2019 14:19
Ender 3 Profile - You'll still need to set the printer size (220/220/250), nozzle diameter (0.4) and enable bed heating.
[profile]
layer_height = 0.15
wall_thickness = 1.2
retraction_enable = True
solid_layer_thickness = 1.2
fill_density = 15
print_speed = 50
print_temperature = 200
print_temperature2 = 0
print_temperature3 = 0

Calculate database size:

SELECT table_schema "db_name",
        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" 
FROM information_schema.tables 
GROUP BY table_schema; 

Count total rows in database:

// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',