Skip to content

Instantly share code, notes, and snippets.

@hugokernel
hugokernel / gist:1089613
Created July 18, 2011 14:08
Nginx / Jelix url significant
We couldn’t find that file to show.
@hugokernel
hugokernel / gist:4058259
Created November 12, 2012 09:03
Hyla : move_uploaded_file -> is_uploaded_file + rename
<?php
/*
This file is part of Hyla
Copyright (c) 2004-2012 Charles Rincheval.
All rights reserved
Hyla 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 2 of the License,
or (at your option) any later version.
@hugokernel
hugokernel / config
Last active March 8, 2017 13:06
i3 configuration file
set $mod Mod4
# font for window titles. ISO 10646 = Unicode
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
@hugokernel
hugokernel / .i3status.conf
Last active October 13, 2015 03:18
i3 status configuration
general {
#output_format = "dzen2"
colors = true
interval = 5
}
#order += "ipv6"
order += "disk /"
#order += "run_watch DHCP"
@hugokernel
hugokernel / gist:4712865
Last active December 12, 2015 04:18
Cura profile
[profile_0]
layer_height = 0.1
wall_thickness = 0.8
retraction_enable = True
solid_layer_thickness = 0.8
fill_density = 40
nozzle_size = 0.4
print_speed = 50
print_temperature = 0
print_temperature2 = 0
@hugokernel
hugokernel / start.gcode
Created June 28, 2014 10:14
start.gcode
;Sliced {filename} at: {day} {date} {time}
;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
;Print time: {print_time}
;Filament used: {filament_amount}m {filament_weight}g
;Filament cost: {filament_cost}
M80 ; Power on !suicide
G21 ;metric values
G90 ;absolute positioning
M107 ;start with the fan off
;M190 S90 ; PLA: Heated bed on !
@hugokernel
hugokernel / end.gcode
Created June 28, 2014 10:15
end.gcode
;End GCode
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off (if you have it)
G91 ;relative positioning
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
M84 ;steppers off
G90 ;absolute positioning
M81 ; Suicide !
@hugokernel
hugokernel / fizzbuzz.py
Last active August 29, 2015 14:04
Mes versions du FizzBuzz en Python (http://sametmax.com/fizzbuzz-en-python/)
# -*- coding: utf-8 -*-
from __future__ import print_function
'''
Écrire un programme qui affiche les nombres de 1 à 199.
Mais pour les multiples de 3, afficher “Fizz” au lieu du nombre et pour les multiples de 5 afficher “Buzz”.
Pour les nombres multiples de 3 et 5, afficher “FizzBuzz”.
'''
# Simple version
@hugokernel
hugokernel / scan.py
Last active October 3, 2017 23:41
Python scanner for first line eval() based infection on php script
'''
Python scanner for first line eval() based infection on php script (ex: Wordpress infection)
Information: http://somewebgeek.com/2014/wordpress-remote-code-execution-base64_decode/
hugokernel, 09/2014
Usage:
python scan.py directory
'''
import sys
@hugokernel
hugokernel / outlet.py
Created May 19, 2015 07:08
Outlet driver
#!/usr/bin/python
import RPi.GPIO as GPIO
from time import sleep
class Power_Outlet:
OUTPUT0 = 12
OUTPUT1 = 11
OUTPUT2 = 13