Skip to content

Instantly share code, notes, and snippets.

# generated by SuperSlicer 2.4 on 2023-06-09 at 19:05:38 UTC
[print:First Layer Test]
allow_empty_layers = 0
avoid_crossing_not_first_layer = 1
avoid_crossing_perimeters = 0
avoid_crossing_perimeters_max_detour = 0
bottom_fill_pattern = monotonicgapfill
bottom_solid_layers = 3
bottom_solid_min_thickness = 0
@jalexandre0
jalexandre0 / printer.cfg
Last active April 15, 2023 13:44
Klipper config for Ender 3 + CR Touch + Dual Gear Extruder
[include mainsail.cfg]
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_19001B000550415339373620-if00
restart_method: command
#[mcu zboard]
#serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_56FF69067189545028462567-if00
#restart_method: command
@jalexandre0
jalexandre0 / check_backup_label.sql
Created July 28, 2020 20:38
SQL to parse and extract information from pg_wal (or pg_xlog) *.backup
SELECT
min(times) AS start_time,
max(times) AS stop_time,
max(times) - min(times) AS duration,
now() - min(times) AS delta_backup_time_from_start,
now() - max(times) AS delta_backup_time_from_finish,
pg_is_in_backup()
FROM
( SELECT
((regexp_matches(pg_read_file(waldir || filename), '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*',
@jalexandre0
jalexandre0 / get_memory_info.sql
Created February 12, 2019 19:03 — forked from fabriziomello/get_memory_info.sql
Get memory info from a certain process
-- https://psutil.readthedocs.io/en/latest/#psutil.Process.memory_full_info
-- Linux: 0=rss, 1=vms, 2=shared, 3=text, 4=lib, 5=data, 6=dirty, 7=uss, 8=pss, 9=swap
CREATE OR REPLACE FUNCTION get_memory_info(pid INTEGER DEFAULT NULL, memtype INTEGER DEFAULT 0)
RETURNS BIGINT
AS
$$
import psutil
p = psutil.Process(pid)
return p.memory_full_info()[memtype]
$$
@jalexandre0
jalexandre0 / gist:aa67d17ef82ea7ec0482fa1701c6582f
Last active October 29, 2017 14:34
Experimental data analysis on brewersfriend recipe database. Work in progress
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jalexandre0
jalexandre0 / massflash.py
Created February 17, 2017 17:39 — forked from geekman/massflash.py
automated ESP8266 programming station to mass flash large quantity of devices quickly
#!/usr/bin/env python
#
# automated ESP8266 programming station
# monitors for inserted serial devices and calls esptool to flash them
# written to mass flash entire batches of ESP8266 devices quickly
# $ pip install esptool pyudev
#
# 2016.06.16 darell tan
#

Keybase proof

I hereby claim:

  • I am jalexandre0 on github.
  • I am jalexandre (https://keybase.io/jalexandre) on keybase.
  • I have a public key whose fingerprint is DD28 0A67 03C1 3A2B 86E1 5580 7765 A07F F9AB B9A5

To claim this, I am signing this object:

#include <PID_v1.h>
#include <PID_AutoTune_v0.h>
#include <OneWire.h>
#include <DallasTemperature.h>
//Pins
#define RelayPin 6
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
// I´m arduino user, not a former programmer. If you have a better approach for brewery, do it!!
// If you found bugs, fix it and ping me. :)
//Libraries
#include <OneWire.h>
#include <DallasTemperature.h>
#include <PID_v1.h>
//Pin 2 for OneWire
//Pin 6 for Heat Element
@jalexandre0
jalexandre0 / code_sample.pl
Created May 21, 2013 14:48
Collections of perl utils and one-liners I use this for personal reference (Yep, TDAH)
#Open File
$input_fh, "<users.txt" or die "Can't open the file" ; close $input_fh ;
# Insert lines into array
while ( $line = <$input_fh> ) { push @array,$line ; }
#Parsing CSV
foreach(@array) {
chomp $_ ;
($user, $password) = split /,/, $_ ;