Skip to content

Instantly share code, notes, and snippets.

View isaactzab's full-sized avatar

Isaac Levi Tzab Poot isaactzab

View GitHub Profile
@isaactzab
isaactzab / download-mp3-youtube-dl.md
Last active August 4, 2023 03:12
Install YouTube-DL in Ubuntu/Linux Mint and Debian

#How to download an MP3 track from a YouTube video You can also download the mp3 directly from youtube without converting using ffmpeg

youtube-dl --extract-audio --audio-format mp3 <video URL>

From the online help:

-x, --extract-audio        convert video files to audio-only files (requires
                           ffmpeg or avconv and ffprobe or avprobe)
@isaactzab
isaactzab / optimizations-for-prestashop-1.6.md
Last active January 18, 2023 22:49
Prestashop tips and tricks

Optimizations and enhancements for prestashop 1.6

Sometimes, prestashop turns very slow due to ads, and module recomendations. Here are some modifications to version 1.6 removing these things and speed up the admin panels. Enjoy and share your tricks about how optimize prestashop.

Modify Tools class

[https://github.com/PrestaShop/PrestaShop/blob/1.6.1.x/classes/Tools.php#L3351-L3356] Find the file /public/classes/Tools.php and modify as next:

public static function addonsRequest($request, $params = array())
@isaactzab
isaactzab / FFmpeg-tricks.md
Last active June 10, 2022 14:30
FFmpeg on ubuntu

FFmpeg Tricks

Repeat/loop Input Video

The -loop option is specific to the image file demuxer and gif muxer, so it can't be used for typical video files, but you can use the concat demuxer.

Concat demuxer

Make a text file. Contents of an example text file to repeat 4 times.

$ cat list.txt
file 'input.mp4'
@isaactzab
isaactzab / stream-audio-to-kodi.md
Last active January 24, 2021 22:40
Streaming Audio From Linux to Raspbmc
A backup from (http://westmarch.j5int.com/2014/04/streaming-audio-linux-to-raspbmc/)
Posted on April 12, 2014 by matth

Streaming Audio From Linux to Raspbmc

Early in 2014, I finally got around to turning my Raspberry Pi in to a little XMBC media centre by installing Raspbmc. Which was fun. And also easy. Perhaps a little too easy: I’m a bit of a nerd, so it didn’t take long to get bored of just playing regular type media off the external hard drive. Part of the reason I have a Raspberry Pi, is for the fun of thinking of what relatively useless thing I might potentially do with it next, and then spending (wasting?) many hours trying to do it. So, as I was trying to decide what to do next, I considered the fact that I fairly often like to play music on my PC while I’m working. And my sound system is now hooked up to the Raspberry Pi. So it would be most convenient if I could just deliver the sound across my network for Raspbmc to play for me. I was running Ubuntu 13.10 – Saucy Salamander – at the tim

@isaactzab
isaactzab / esSetup.sh
Created December 6, 2019 20:40 — forked from christeredvartsen/esSetup.sh
Setup elasticsearch on CentOS
#!/bin/bash
# Script used to setup elasticsearch. Can be run as a regular user (needs sudo)
ES_USER="elasticsearch"
ES_GROUP="$ES_USER"
ES_HOME="/usr/local/share/elasticsearch"
ES_CLUSTER="clustername"
ES_DATA_PATH="/var/data/elasticsearch"
ES_LOG_PATH="/var/log/elasticsearch"
ES_HEAP_SIZE=1024
@isaactzab
isaactzab / bash_array_operations.md
Last active November 8, 2019 16:44
Bash Scripting

Modify bash array items without looping

Original post from: http://codesnippets.joyent.com/posts/show/1826

replace any "ba" substring with "TT" in every array item

array=( foo babar baz )
array=( "${array[@]//ba/TT}" )
echo "${orig[@]}"$'\n'"${array[@]}"
@isaactzab
isaactzab / overkill.sh
Last active October 1, 2019 22:37
Terminal Helpers
#!/bin/sh
# kill all proccess with name provided
if [ ! -z "${1}" ]
then
kill -9 $(ps aux | grep "${1}" | awk '{print $2}')
else
echo "Please provide an process name to kill all related process"
fi
exit
@isaactzab
isaactzab / youtube-gif.sh
Created May 29, 2019 20:46 — forked from hubgit/youtube-gif.sh
Convert a section of a YouTube video to an animated GIF
#!/bin/bash
# brew install rtmpdump
# brew install ffmpeg
# brew install youtube-dl
# brew install imagemagick
ID='c5kuYfTCGLg' # YouTube video ID, i.e. https://www.youtube.com/watch?v={ID}
# fetch the video file with youtube-dl
@isaactzab
isaactzab / rest.py
Created March 22, 2019 16:27 — forked from tliron/rest.py
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library.
#!/usr/bin/env python
'''
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library.
Features:
* Map URI patterns using regular expressions
* Map any/all the HTTP VERBS (GET, PUT, DELETE, POST)
* All responses and payloads are converted to/from JSON for you
@isaactzab
isaactzab / hashify
Created March 20, 2019 22:56
Generate passwords / hash from string / random string - Terminal OSX (with some adjusments will you run in linux)
#!/bin/sh
# usage:
# 1- First argument: String seed
# 2- Second argument: Hash length
# $hashify "my string seed" 10
LENGTH_STRING=${2:-8}
SEED_STRING=$1
md5 <<< ${SEED_STRING} | base64 | awk -v lenstr="$LENGTH_STRING" '{print substr ($0, 10, lenstr)}'