Skip to content

Instantly share code, notes, and snippets.

:octocat:
yeah yeah yeah

Flug flug

Block or report user

Report or block flug

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a90f7ad8ac5ea093deb82359ac0dd2b9
{
"id": "cae09dbe-9597-41a0-82a4-a7d6f4b8db65",
"title": "Tome 40",
"number": 40,
"date_parution": "2019-04-17",
"img": "https://images-eu.ssl-images-amazon.com/images/I/411dOaqaHbL.jpg",
"isbn": "9782344033845",
"asin": "234403384X",
"edition_id": "7f034034-5a65-45dd-b6f3-90d261525884",
"possessions_count": 129,
View steeper
This file has been truncated, but you can view the full file.
;Gcode by Cura-by-dagoma for DiscoEASY200 V1.0.4
G90 ;absolute positioning
M106 S250 ;fan on for the palpeur
G28 X Y
G1 X50
M109 S180
G28
M104 S215
;Activation palpeur
View settings.cnf
$0=10
$1=25
$2=0
$3=4
$4=0
$5=0
$6=0
$10=3
$11=0.020
$12=0.002
@flug
flug / BookController.php
Created Jan 22, 2019 — forked from silviuvoicu/BookController.php
Spec with phpspec a symfony2 controller. I know which is the normal work flow: write first the spec, and then the code, but in order to understand better how to spec a symfony2 controller, I first create a simple book entity with just id and name, and then with the help of generators I created a crud system, which I modified a little. Then havin…
View BookController.php
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Acme\DemoBundle\Entity\Book;
@flug
flug / gist:78713cda69bfb8126fb308bc716d1cc8
Created Aug 8, 2018 — forked from jpetitcolas/gist:5967887
Encode/decode a base64 encoded string in PostGreSQL
View gist:78713cda69bfb8126fb308bc716d1cc8
-- Decoding
SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table;
-- Encoding
SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table;
View Copy.dockerfile
FROM composer/composer:1.1 as composer
ARG version=dev-master
ARG http_version=dev-master
RUN mkdir /ppm && cd /ppm && composer require php-pm/php-pm:${version} && composer require php-pm/httpkernel-adapter:${http_version}
FROM alpine:3.7
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
View example.csv
We can't make this file beautiful and searchable because it's too large.
"France, Nouvelle-Calédonie, Récifs de l'Astrolabe (eaux territoriales)","{""type"":""MultiPolygon"", ""coordinates"":[[[[165.3042754,-19.8832031],[165.3045067,-19.890205],[165.3049962,-19.8971949],[165.3057434,-19.9041645],[165.3067473,-19.9111051],[165.3080069,-19.9180084],[165.3095205,-19.9248659],[165.3112865,-19.9316693],[165.3133026,-19.9384102],[165.3155664,-19.9450805],[165.3180753,-19.951672],[165.3208261,-19.9581766],[165.3238156,-19.9645865],[165.3270401,-19.9708937],[165.3304958,-19.9770907],[165.3353434,-19.9849952],[165.3393153,-19.9909094],[165.3435034,-19.996689],[165.3479026,-20.0023267],[165.3525077,-20.0078157],[165.357313,-20.0131493],[165.3623126,-20.0183211],[165.3675004,-20.0233246],[165.3728703,-20.0281538],[165.3784155,-20.0328027],[165.3841293,-20.0372658],[165.3900049,-20.0415374],[165.3960349,-20.0456125],[165.4022121,-20.049486],[165.4085288,-20.0531531],[165.4149775,-20.0566095],[165.4248805,-20.0613896],[165.4350353,-20.0656728],[165.445414,-20.0694473],[165.455988,-20.0727028],
View base conf worker supervisord.ini
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/forge/app.com/artisan queue:work sqs --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=forge
numprocs=8
redirect_stderr=true
stdout_logfile=/home/forge/app.com/worker.log
View mysql bin log
# mysqlbinlog mysql-bin.005757 | grep -i -e "^update" -e "^insert" -e "^delete" -e "^replace" -e "^alter" | cut -c1-100 | tr '[A-Z]' '[a-z]' | sed -e "s/\t/ /g;s/\`//g;s/(.*$//;s/ set .*$//;s/ as .*$//" | sed -e "s/ where .*$//" | sort | uniq -c | sort -nr | head -50
@flug
flug / readme.md
Last active Sep 15, 2017
Lock and unlock session linux with usb key
View readme.md

reference : https://askubuntu.com/questions/194027/locking-with-usb-drive

Well, a module called PAM (Pluggable Authentication module) can be customized to achieve your need. A beautiful article is available on linuxconfig describing this in detail.

The steps are:

Install PAM

$ sudo apt-get install pamusb-tools libpam-usb

Add USB device to PAM config

You can’t perform that action at this time.