Skip to content

Instantly share code, notes, and snippets.

View elalemanyo's full-sized avatar
🥘
NaN

victor elalemanyo

🥘
NaN
View GitHub Profile
@elalemanyo
elalemanyo / raspberrypi_vnc.md
Last active September 18, 2015 14:25
Installing VNC server on Raspberry Pi for remote desktop functionality
  1. sudo apt-get install x11vnc

  2. Make x11vnc server start with LXDE

    cd .config
    mkdir autostart
    cd autostart
    nano x11vnc.desktop
    
// Video mosaic
ffmpeg
-i 1.mp4 -i 2.mp4 -i 3.mp4 -i 4.mp4
-filter_complex "
nullsrc=size=1280x720 [base];
[0:v] setpts=PTS-STARTPTS, scale=640x360 [upperleft];
[1:v] setpts=PTS-STARTPTS, scale=640x360 [upperright];
[2:v] setpts=PTS-STARTPTS, scale=640x360 [lowerleft];
[3:v] setpts=PTS-STARTPTS, scale=640x360 [lowerright];
[base][upperleft] overlay=shortest=1 [tmp1];
@elalemanyo
elalemanyo / ampify_img.php
Last active August 27, 2021 12:33
Make img AMP-ready
<?php
/**
* Replace img tag with amp-img
*
* <amp-img src="[src]"
* width="[width]"
* height="[height]"
* layout="responsive"
* alt="[alt]">
* </amp-img>
@elalemanyo
elalemanyo / .htaccess
Created January 9, 2018 11:20
Site Files Redirect D7
### Apache Rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
# Force image styles that have local files that exist to be generated.
RewriteCond %{REQUEST_URI} ^/sites/([^\/]*)/files/styles/[^\/]*/public/((.*))$
RewriteCond %{DOCUMENT_ROOT}/sites/%1/files/%2 -f
RewriteRule ^(.*)$ $1 [QSA,L]
# Otherwise, send anything else that's in the files directory to the
# production server.
RewriteCond %{REQUEST_URI} ^/sites/[^\/]*/files/.*$
@elalemanyo
elalemanyo / .aliases
Created February 20, 2018 13:27
Alias
# -------------------------------------------------------------------
# Drush
# https://www.lullabot.com/articles/switching-drush-versions
# -------------------------------------------------------------------
# alias drush6='/www/drush6/vendor/bin/drush'
# alias drush='/www/drush7/vendor/bin/drush'
# alias drush8='/www/drush8/vendor/bin/drush'
# -------------------------------------------------------------------
# Clear
@elalemanyo
elalemanyo / .bashrc
Created August 21, 2018 14:47
Run line "starting with" inside travis.yml
travis() {
command=$(grep -oP "(?<=- )$1.*" .travis.yml);
echo -e "\e[1;32mRunning: $command\e[0m\n";
eval $command;
}
@elalemanyo
elalemanyo / raspbian_ssh_wifi.md
Last active September 23, 2018 12:23
Headless Raspberry PI + SSH + Wifi (Raspbian Stretch)

1. Burn the Raspbian image to the SD card

2. Enable ssh

For security reasons, ssh is no longer enabled by default. To enable it you need to place an empty filed named ssh (no extension) in the root of the boot disk. touch /Volumes/boot/ssh

3. Add network info

Create a file in the root of boot called: wpa_supplicant.conf. Then paste the following into it:

country=US
@elalemanyo
elalemanyo / README.md
Created September 23, 2018 19:07
Assign the .local Domain to Your Raspberry Pi

Assign the .local Domain to Your Raspberry Pi

sudo apt-get install avahi-daemon

Once the installation process is complete, you don’t even have to reboot the device. Your Raspberry Pi will begin immediately recognizing local network queries for its hostname (by default “raspberrypi“) at raspberrypi.local.

@elalemanyo
elalemanyo / README.md
Last active October 11, 2018 17:38
Recompile Heroku
git commit --allow-empty -m "empty commit"
git push heroku master

or

git commit --amend -C HEAD
git push heroku master
@elalemanyo
elalemanyo / README.md
Created October 12, 2018 12:09
Moving commits to a new branch

WARNING: This method works because you are creating a new branch with the first command: git branch newbranch. If you want to move commits to an existing branch you need to merge your changes into the existing branch before executing git reset --hard HEAD~3

git branch newbranch 
git reset --hard HEAD~3
git checkout newbranch