virtualbox disk backup

#!/bin/bash
OSUSER=vbuser
VMNAME=vmname
VMFILE=/mnt/share/CentOS7.vdi
VMBACKUP=/mnt/share/backup/CentOS7.vdi
VBOXFILE=/mnt/share/CentOS7.vbox
VBOXBACKUP=/mnt/share/backup/CentOS7.vbox
DATETIME=`date "+%Y-%m-%d %H:%M:%S"`

echo -e "\n$DATETIME\n" >> /var/log/backup-vm.log 2>&1
echo -e "saving state for $VMNAME...\n" >> /var/log/backup-vm.log 2>&1
sudo -u $OSUSER VBoxManage controlvm $VMNAME savestate >> /var/log/backup-vm.log 2>&1
sleep 30
echo -e	"starting backup of vmdisk..." >> /var/log/backup-vm.log 2>&1
sudo -u $OSUSER cp -f $VMFILE $VMBACKUP
sudo -u $OSUSER cp -f $VBOXFILE $VBOXBACKUP
sleep 10
echo -e "\nrestarting $VMNAME...\n" >> /var/log/backup-vm.log 2>&1
sudo -u $OSUSER VBoxManage startvm $VMNAME --type headless >> /var/log/backup-vm.log 2>&1

 

laravel

– check for Php TimeZone into /etc/php.ini file

– setup http_proxy https_proxy
$ export http_proxy=...
$ export https_proxy=...

– update cafile config
$ php -r "print_r(openssl_get_cert_locations());"
copy from browser CA cert .pem file into a folder
create /etc/php.d/99composer.ini file with openssl.cafile = <downloaded CA cert file path>

– download composer
$ curl -sSk https://getcomposer.org/installer php -- --disable-tls
$ rm -rf composer-setup.php
$ php composer.phar config -g -- disable-tls true

mono parallel

source post: http://www.mono-project.com/docs/compiling-mono/parallel-mono-environments/

  • install deps
# urpmi lib64jpeg-devel lib64gif-devel lib64tiff-devel lib64png-devel lib64png12-devel lib64pnglite-devel lib64gladeui1-devel lib64glade2.0_0-devel lib64glademm2.4-devel lib64gladeui2-devel
  • enable optional environment
create script ~/mono-dev-env following previous article
$ source ~/mono-dev-env
  • compile libgdiplus
$ ./configure --prefix=/opt/mono
$ make
$ sudo make install
  • compile mono
$ ./configure --prefix=/opt/mono
$ make
$ sudo make install

 

  • compile gtk-sharp2
$ ./configure --prefix=/opt/mono
$ make
$ sudo make install

 

  • compile mono-tools
$ ./configure --prefix=/opt/mono
$ make
$ sudo make install

pyLoad package_finished script

pyload/scripts/package_finished/ExternalScript.sh:

#!/bin/sh -e
screen -d -m /opt/bin/extract_rar "$@"


/opt/bin/extract_rar:
#!/bin/sh -e

# set local vars
DLN_ID="$1"
DLN_NAME="$2"
DLN_FOLDER="$3"
DLN_PWD=""

if [ ! -z "$4" ] ; then
    # password passed
    DLN_PWD="-p$4"
fi

for entry in "$DLN_FOLDER"/*.rar
do
  if [ -f "$entry" ]then
    DLN_FILE="$entry"

    break
  fi
done

# debug command to file
echo "unrar e $DLN_PWD $DLN_FILE" >> /opt/var/log/pyload_package_finished.log

echo "---" >> /opt/var/log/pyload_package_finished.log

# extract
cd "$DLN_FOLDER"
unrar e $DLN_PWD $DLN_FILE

# remove rev and rar files
rm -rf *.rar
rm -rf *.rev

 

debian packaging

update local repo keys with same ppa key

modify ~/.dput.cf file

[armando]
fqdn = ppa.launchpad.net
method = ftp
incoming = ~<launchpad-username>/ubuntu/testing/
login = anonymous
allow_unsigned_uploads = 0

create debian folder into source root folder
$ dh_make -s -e <email> -n -c gpl2

modify:
– changelog
– install (or more xxx.install) file
– compat
– control
– copyright
– rules

testing package with
$ debuild -us -uc

generate …source.changes file with
$ debuild -S -sa

upload package
$ dput armando <source.changes path>

pencil with xulrunner

download xulrunner from http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/
download pencil from https://github.com/prikhi/pencil
download lollipop icons from https://github.com/nathanielw/Android-Lollipop-Pencil-Stencils
extract zip and create new zip with folders icons, misc and other files in main folder.

launch pencil with:
$ ./xulrunner <app path>/evolus-pencil/application.ini

import collection from Tools menu

git submodule

to add submodule
$ git submodule add git@mygithost:billboard lib/billboard -b master
to init and update
$ git submodule init
$ git submodule update
$ cd lib/billboard
$ git pull
$ cd ../..
$ git add lib/billboard
to remove submodule
$ git submodule rm lib/billboard
$ git rm --cached lib/billboard