Linux / Windows – what’s the difference…

How to install Symfony3 under shared webhosting in Developement mode

1. Log in to SSH 2. Install Composer (We assume that composer is not yet installed): export COMPOSERDIR=~/bin;mkdir bin curl -sS | php — –install-dir=$COMPOSERDIR –filename=composer (Composer will be installed under: /home/username/bin/composer ) 3. To test that installation was successful – You can run: ~/bin/composer 4. Make environment global INSTALLDIR: export INSTALLDIR=~/public_html/symfony mkdir $INSTALLDIR […]

, , ,

All local mail sent out via external smarthost (Exim4 on Ubuntu 16.04)

Steps to do: 1. First run (start basic exim conf): sudo dpkg-reconfigure exim4-config And use these config options: General type of mail configuration: mail sent by smarthost; received via SMTP or fetchmail System mail name: IP-address to listen on for incoming SMTP connections:, ::1 Other destinations for which mail is accepted: Machines to relay […]

unserialize() : Error at offset XX:XXX

Food for thought: 1. Probably Your charset is wrong (after PHP 5.5) – Set charset after open tag: header('Content-Type: text/html; charset=utf-8'); – And set charset utf8 in your database : mysql_query("SET NAMES 'utf8'"); 2. Your serialized array is faulty Could be fixed by: $fixed_data = preg_replace_callback ( '!s:(\d+):"(.*?)";!', function($match) { return ($match[1] == strlen($match[2])) ? […]

NetBeans on Ubuntu

Earlier I had version NB 8.0.* on my laptop – worked like a charm. On Ubuntu 16.04 I installed NB 8.1.* via official repo – and that’s where the problems started… I had no luck enabling auto-completion from included file – Interwebs was full of probable “solutions” to remove cache and/or to check settings and/or […]

Bash script to run via command-line to lowercase all file- and folder names in current folder recursively

#!/bin/bash # first, rename all folders for f in `find . -depth ! -name CVS -type d`; do g=`dirname "$f"`/`basename "$f" | tr '[A-Z]' '[a-z]'` if [ "xxx$f" != "xxx$g" ]; then echo "Renaming folder $f" mv -f "$f" "$g" fi done # now, rename all files for f in `find . ! -type d`; […]

How to change Linux files/folders permissions under same directory recursively 644/755

One approach would be: find . -type d -print0 | xargs -0 chmod 0755 find . -type f -print0 | xargs -0 chmod 0644 Other approach: find /full/path/to/your/files -type f -exec chmod 644 {} \; find /full/path/to/your/files -type d -exec chmod 755 {} \; NB! Please do note that -f option is for files and […]

Nifty feature to change text inside large file over Linux commandline

sed -i 's/original/new/g' file.txt sed = Stream EDitor -i = in-place (i.e. save back to the original file) s = the substitute command original = a regular expression describing the word to replace (or just the word itself) new = the text to replace it with g = global (i.e. replace all and not just […]

Letsencrypt on Ubuntu 16.04 LAMP howto commandline

1. Install Letsencrypt with apache addon: sudo apt-get install python-letsencrypt-apache 2. Generate only cert for domain letsencrypt –apache certonly If above fails: 1. For different webroot letsencrypt certonly -a webroot –webroot-path=/var/www/ -d 2. If apache fails or port 443 fails – do manual over HTTP letsencrypt certonly –standalone-supported-challenges http-01 NB! Apache needs fullkeychain and […]

Restoring MySQL root user privileges when corrupt (in linux)

1. On commandline (shut down mysql and start mysqld_safe without grant tables): sudo /etc/init.d/mysql stop sudo mysqld_safe –skip-grant-tables & 2. On new terminal window (log on and execute code as shown): mysql UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root'; FLUSH PRIVILEGES; GRANT ALL ON *.* TO 'root'@'localhost'; FLUSH PRIVILEGES; 3. Kill mysqld_safe instance 4. Log […]

, , , ,

Kuidas kasutada Windows OS’is DIG’i

DIG käsud ja seletused on leitavad lehelt: DIG Windowsile on alla laetav BIND paketi osana lehelt:

Previous Posts