Skip to content

Instantly share code, notes, and snippets.

View bluvertigo's full-sized avatar

Andrea Gentili bluvertigo

View GitHub Profile

echo "/dev/sd2 /mnt/USBname ntfs rw,nosuid,nodev,nofail,x-gvfs-show,users,uid=1000,gid=1000,dmask=002,fmask=113,nobootwait 0 0" >> /etc/fstab

pv dump.sql| mysql -u root -ppassword -h 127.0.0.1 magento

<?
declare(strict_types=1);
use Magento\Sales\Model\Order\Item;
use Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory as ItemCollectionFactory;
class Example
{
/**
```
plugins=(git commonaliases sudo vagrant command-not-found compleat composer cp bgnotify pass dirhistory git-extras docker docker-compose jsontools colorize copydir copyfile history capistrano)
```
```
git commonaliases sudo vagrant command-not-found compleat composer cp ubuntu bgnotify pass chucknorris dirhistory git-extras docker docker-compose jsontools colorize copydir copyfile history lol capistrano kubectl terraform
```
`dirhistory`
@bluvertigo
bluvertigo / timelapse.md
Last active March 29, 2018 11:46 — forked from porjo/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

@bluvertigo
bluvertigo / xml.php
Last active March 15, 2018 13:48
Gestione XML con PHP
<?php function SingoloXml()
{
$doc = new DOMDocument;
$l1 = $doc->createElement("L1");
$l2 = $doc->createElement("L2");
$l1->appendChild($l2);
$doc->appendChild($l1);
wpa_passphrase ESSID passoword_wifi >> /etc/wpa_supplicant/wpa_supplicant.conf
<?php
public function create()
{
$productCollection = $this->_getProductCollection();
$pages = $productCollection->getLastPageNumber();
$pageNumber = 1;
do {
$productCollection->setCurPage($pageNumber);
$productCollection->load();
foreach ($productCollection as $product) {
@bluvertigo
bluvertigo / timelapse.sh
Created February 9, 2018 12:54
Script generate timelaps
#!/bin/sh
mkdir resized
mogrify -path resized/ -resize x1080 `find . -name '*.JPG'`
cd resized
cat *.JPG | ffmpeg -f image2pipe -r 5 -vcodec mjpeg -i - -vcodec libx264 -movflags faststart out.mp4