Skip to content

Instantly share code, notes, and snippets.

View hqmatics's full-sized avatar

Tjerk Hacquebord hqmatics

View GitHub Profile
git log --all --full-history -- "**/the-file.xml"
@hqmatics
hqmatics / clean-prestashop-db.sql
Last active October 2, 2019 08:27
Clean PrestaShop database
# Delete all logs
TRUNCATE log;
# Delete old connection data (only used for stats)
DELETE c, cs
FROM connections c
LEFT JOIN connections_source cs ON (c.id_connections = cs.id_connections)
WHERE c.date_add < 'YYYY-MM-DD 00:00:00';
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative release/20180513..test
smb21enable
smb2status
testparm -v
testparm -v | grep "protocol"
/etc/init.d/smb.sh restart
@hqmatics
hqmatics / Install Bolt.sh
Created May 1, 2017 17:38
Install Bolt.cm with Composer
composer create-project bolt/composer-install:^3.2 [PROJECT] --prefer-dist --no-interaction
@hqmatics
hqmatics / fdisk.sh
Created August 19, 2016 13:08
Format SD and write ArchLinux
umount /dev/sdc1
sed -e 's/\t\([\+0-9a-zA-Z]*\)[ \t].*/\1/' << EOF | fdisk /dev/sdc
o
n
p
1
+100M
t
@hqmatics
hqmatics / gist:cc84c53face97498034776366701a5f0
Created June 22, 2016 06:38
Git list branches with date
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
iptables -A INPUT -s [IP] -j DROP
@hqmatics
hqmatics / wiegand.c
Created September 1, 2014 14:19 — forked from hsiboy/wiegand.c
/*
* Wiegand API Raspberry Pi
* By Kyle Mallory All rights reserved.
* 12/01/2013
* Based on previous code by Daniel Smith (www.pagemac.com) and Ben Kent (www.pidoorman.com)
* Depends on the wiringPi library by Gordon Henterson: https://projects.drogon.net/raspberry-pi/wiringpi/
*
* This is linked with -lpthread -lwiringPi -lrt
*
* The Wiegand interface has two data lines, DATA0 and DATA1. These lines are normall held
@hqmatics
hqmatics / passwordhashing.php
Created August 19, 2013 06:03
PHP Password hashing
<?php
$username = 'Admin';
$password = 'gf45_gdf#4hg';
// A higher "cost" is more secure but consumes more processing power
$cost = 10;
// Create a random salt
$salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');