Start using Digital Ocean and get $10 credit
If you are about to start using Digital Ocean use this link www.digitalocean.com/?refcode=29ad12482ef3 and you will get $10 credit for free. I will also get some credit if you spend some money there :)
almost home
Misplaced Lens Cap
hello vonnie
styofa doing anything
ojovivo

oozey mess

❣ Chile in a Photography ❣

tannertan36
"I'm Dorothy Gale from Kansas"

@theartofmadeline
Monterey Bay Aquarium
sheepfilms

roma★
Claire Keane
trying on a metaphor

Kaledo Art
i don't do bad sauce passes

JVL
art blog(derogatory)

JBB: An Artblog!
seen from Taiwan

seen from Japan

seen from United States

seen from Latvia

seen from South Africa
seen from United States

seen from Australia
seen from United Kingdom
seen from United States

seen from Canada

seen from Malaysia
seen from United States

seen from Bulgaria
seen from United States

seen from Bulgaria
seen from South Africa

seen from United States

seen from France

seen from Malaysia

seen from United States
@michalknazsky
Start using Digital Ocean and get $10 credit
If you are about to start using Digital Ocean use this link www.digitalocean.com/?refcode=29ad12482ef3 and you will get $10 credit for free. I will also get some credit if you spend some money there :)
Mongo and Ubuntu - problem with locale settings
Newer versions of MongoDB started to throw the following error on my Ubuntu/Debian servers:
"Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly."
The fix is easy, go to /etc/default/locale and add something like this:
LANG="en_US.UTF-8" LANGUAGE="en_US" LC_ALL="en_US.UTF-8"
Then restart the session and run mongo - it should start without previous error.
Create square thumbnails with ImageMagic
mogrify \ -thumbnail 175x175^ \ -gravity center \ -crop 175x175+0+0 \ +repage \ -format jpg \ -quality 75 \ -path thumbs \ *.jpg
Install Wordpress with Docker
Imagine common usecase: you need to do some Wordpress development - like new theme, plugin, whatever... so you need to get up the fresh Wordpress installation. It includes to get the MySQL and Apache running, do some configs, getting the newest Worpdress copy...
I heard many nice words about Docker, lets see if it can be any help.
Install Docker (it is better to get the newest stable version, not the old one in distro repos): https://docs.docker.com/installation/
For Ubuntu 14.04:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker
Add user to docker group, so you can use docker command without sudo (must log out and in to take the effect):
usermod -a -G docker USER
Get the Docker image witch contains something like LAMP with Wordpress:
docker pull tutum/wordpress
Now we have everything prepared. Create and run the wordpress instance on localhost with port 8888:
docker run -p 127.0.0.1:8888:80 --name="wp-test" tutum/wordpress
You should see WP installation page when accessing localhost:8888. It is that simple. You can run another worpdress instances, just change the port and name in above command
To stop the container press CTRL+C, or use:
docker stop wp-test
Please be aware that "docker run" always creates the new instance (new container) from the image. So to start existing stopped container use:
docker start wp-test
Get the list of running containers:
docker ps
Start shell session within running container (you need docker 1.3+ to do this):
docker exec -it "wp-test" bash
Stop all Docker containers:
docker stop $(docker ps -aq)
Remove all Docker containers:
docker rm $(docker ps -aq)
Handy cheatsheet: https://github.com/wsargent/docker-cheat-sheet
Thanks Tomas Tomecek for the help with Docker.
Debug phonegap app with logcat
adb logcat CordovaLog:D *:S
How to install phonegap for android development
I wrote down steps needed to start developing android application with phonegap on ubuntu 14.04:
Install java and ant (I am using openjdk 7):
sudo apt-get install openjdk-7-jdk sudo apt-get install ant
Download android sdk or adt.
UPDATE PATH! This step is often missing in tutorials. Add path to android sdk to ~/.profile or ~/.bashrc like this:
export PATH=${PATH}:/home/user/adt-bundle-linux-x86_64/sdk/platform-tools:/home/user/adt-bundle-linux-x86_64/sdk/tools
Install node.js - if node from official ubuntu repository is not working, use these instructions, or just install node like this:
sudo apt-get install python-software-properties python g++ make sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs
Install phonegap/cordova cli with npm (npm should be already installed along with node.js):
sudo npm install -g cordova
Now we should be able to create new phonegap app for android:
cordova create my_first_app com.example.myfirstapp MyFirstApp cd my_first_app cordova platform add android
If using 64bit system and cordova build is failing, run these lines:
sudo dpkg --add-architecture i386 sudo apt-get -qqy update sudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386
How to install cordova with npm to ubuntu if the official instructions throws cordova: command not found
Tips and tweaks for beginners with Ubuntu and Linux Mint, the easiest kinds of Linux!
The Exceptional Performance team has identified a number of best practices for making web pages fast.
New fork is here: https://github.com/STRML/node-toobusy
I found nice centos script for redis-server, dont know why the default was not working for me...
Python lock decorator
Here is small code snippet implementing python decorator for locking. I wrote the code for use with celery workers - workers read and modify shared dictionary and I need to keep this operations synced, so each method which is working with dictionary are decorated with synchronized decorator:
from multiprocessing import Manager manager = Manager() plock = manager.Lock() shared_dict = manager.dict() def synchronized(lock=plock): '''Sync decorator.''' def wrap(f): def new_function(*args, **kw): ret = None have_lock = False try: have_lock = lock.acquire() if have_lock: print 'Have lock' ret = f(*args, **kw) finally: if have_lock: print 'Releasing lock' lock.release() return ret return new_function return wrap
Vertical centering text in div
Wow I found some useful tricks how to center text in div: http://www.vanseodesign.com/css/vertical-centering/.
This is probably the best one - it works even when both height of text and height of parent div are not known:
.parent { position: relative; } .centeredchild { text-align: center; position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 50%; height: 30%; margin: auto; }