August 1, 2016

[SOLVED] Create copy of Raspberry PI SD-Card


sudo fdisk -l

Take note of how the SD card is identified.
In my case it is /dev/sdb1.
Then:
sudo dd bs=4M if=/dev/sdb | gzip > /home/your_username/image`date +%d%m%y`.gz

This will compress the image using gzip.
To restore the backup on SD card:
sudo gzip -dc /home/your_username/image.gz | sudo dd bs=4M of=/dev/sdb

June 3, 2016

[SOLVED]Renew ssl letsencrypt certificate on bitnami server

#!/bin/bash
#renew ssl letsencrypt certificate on bitnami server
#https://gist.github.com/printminion/6ec2fc0fefaba8e0a98a63a6d73b0802/edit

sudo /opt/bitnami/ctlscript.sh stop apache
cd /home/user/certbot
#./certbot-auto certonly --standalone -w /opt/bitnami/apache2/conf/ -d example
.com -d www.example.com
./certbot-auto renew
sudo cp /etc/letsencrypt/live/example.com/fullchain.pem /opt/bitnami/apache2/conf/server.crt
sudo cp /etc/letsencrypt/live/example.com/privkey.pem /opt/bitnami/apache2/conf/server.key
sudo /opt/bitnami/ctlscript.sh start apache


Gisthttps://gist.github.com/printminion/6ec2fc0fefaba8e0a98a63a6d73b0802

June 2, 2016

[SOLVED] Set hostname to to terminal window




Add this to your .bashrc file:

show only hostname

PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME}\007"'

show user@hostname and path

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

Source: http://tldp.org/HOWTO/Xterm-Title-4.html

February 13, 2016

[SOLVED]Create CRC list of files in directory recursively on Busybox (Synology)

Create CRC list of files in directory recursively on Busybox (Synology)

  find -type f -print0 | xargs -0 cksum > checklist.chk

 exclude Synology's @eaDir-Dirs
  find -type f ! -path "*/@eaDir/*" -print0 | xargs -0 cksum > checklist.chk

 You can also try to install md5sum via ipkg

January 22, 2016

November 26, 2015

[SOLVED] Gulp. No path specified! Can not get relative

If you getting something like this on image optimization task

/xxx/node_modules/gulp/node_modules/vinyl-fs/node_modules/vinyl/index.js:153
    if (!this.path) throw new Error('No path specified! Can not get relative.'


Check if you have files/folders with spaces

$ find  . -type f -name '*.*' | grep " "


Rename the files/folders

try one more time

October 15, 2015

[SOLVED] "The state token is invalid or has expired. Please try again."


If you are getting the "The state token is invalid or has expired. Please try again." while building an Add-on for Google Drive Documents/Sheets with oAuth.

 
It is possible that your OAuth server just cuts off the part of the state token parameter.
   


In case of magento just increase the size of oauth callback_url columns from 255 to 512 chars.

 
ALTER TABLE oauth_consumer MODIFY callback_url VARCHAR(512);
ALTER TABLE oauth_consumer MODIFY rejected_callback_url VARCHAR(512);
ALTER TABLE oauth_token MODIFY callback_url VARCHAR(512);


Or via update script (something like that)

$adapter = $installer->getConnection(); 
$tagsTableName = $installer->getTable('oauth/consumer'); 
$adapter->modifyColumn($tagsTableName, 'callback_url', 'VARCHAR(512)'); 
$adapter->modifyColumn($tagsTableName, 'callback_url', 'VARCHAR(512)'); 
$tagsTableName = $installer->getTable('oauth/token'); 
$adapter->modifyColumn($tagsTableName, 'callback_url', 'VARCHAR(512)'); 
$installer->endSetup();