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 / balena-cli_windows_wsl.md
Created June 4, 2019 12:56
Install balena-cli on windows 10 wsl
@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',
@dansku
dansku / openbalena-start.md
Created March 15, 2019 09:42
openBalena VPS Configuration

Locally installing to a server

Pre-requisites

# /etc/systemd/system/docker.service.d/override.conf
[Service]
// Package raindrops provides all the tools for the raindrops exercism task.
package raindrops
import "strconv"
// Convert gets an integer number and returns the right string output as requested in the task.
func Convert(number int) string {
var raindrop string
if number%3 == 0 {
// Package raindrops provides all the tools for the raindrops exercism task.
package raindrops
import (
"strconv"
"strings"
)
// Contains check if string exists in slice
func Contains(text string, slice []string) bool {
@dansku
dansku / brach_fix.sh
Last active March 8, 2019 08:29
organizing long list of txt files
#!/bin/bash
DIR=/home/parse/big_lists2/
i=1
for fullfile in $DIR*.txt; do
filename=$(basename -- "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}"
hash=$(md5sum "${fullfile}"|cut -d' ' -f1)
echo "Moving" $filename".txt to "$filename
echo "[$i] Making directory folder_$i"
@dansku
dansku / import.py
Created March 5, 2019 13:48 — forked from youkergav/import.py
Python script to import BreachCompilation to PostgreSQL database.
# Define imports.
from time import time, strftime
from datetime import datetime
from glob import iglob
from os import path, system
from sys import exc_info
from subprocess import Popen, PIPE
from curses import initscr, noecho, cbreak, echo, nocbreak, endwin
from psycopg2 import connect