Small bash commands for linux administration

Mostly useful for Ubuntu or debian based operating system. Top 10 largest directories du -a /var | sort -n -r | head -n 10 Find largest files on Linux find / -size +10M -ls find / -size +700M -ls Top 10 processes by memory ps aux --sort -rss | head Bash check timing time measure…

Got a Xiaomi Mi Band

My best spent 15 euro. It's not that ugly, counts my steps, tracks my sleep, 3 alarms with nice vibrate, solid battery (lasts 1 month), phone call notification, smart lock (my fave) etc etc. This little guy is pretty talented. Plus apparently so durable. One of the redditors made it…

Oneplus One screen replacement tips

After disassembling and assembling my opo like 30 times, I feel competent to write this post. I bought the screen from AliExpress and chose DHL and it arrived in less than 1 week. There is also a small toolkit for screen replacement operation. I don't like the idea of heating…

Small Google App Engine gotchas

Working with GAE is sometimes tough in the beginning. GQL queries must not have " in it. Instead ' single quotation must be used. GQL does not have LIKE You can not put the fields which are not indexed into the WHERE statement. Adding the field into index.yaml is not…

Scraping web with python and selenium

A couple of weeks ago, I had a need to parse some parts of some web page. It was a page whose main content is loaded after finishing the GET request to the page. This means that python's urllib, urllib2 and requests packages will fail to download the exact same…

Some handy Android code snippets

Email Validation public static boolean validateEmail(String email) { return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches(); } Share Button Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); sharingIntent.setType("text/plain"); Resources res = activity.getResources(); String shareSubject = res.getString(R.string.share_subject); String shareVia = res.getString(R.string…

How to update nodejs on Ubuntu (Debian)

Thanks StackOverflow! First method: Through NPM sudo npm cache clean -f sudo npm install -g n sudo n stable node -v Second method: Through NVM curl https://raw.github.com/creationix/nvm/master/install.sh | sh source ~/.profile nvm install 0.10.26 nvm use v0.10.26 which node…

Use Google App Engine Applications with Custom Domains for free

I like free. Looked for a good resource to achieve this. However, most of them are outdated and they say that to be able to use GAE apps with custom domain, you need a Google Apps account no you don't. Plus, if you add your appid.appspot.com to your…

Deploy web.py applications with pip requirements on Heroku

Running and deploying python apps on Heroku is pretty easy. I usually use web.py and Jinja2 templates for a typical web server. Install heroku toolbet Login to heroku heroku login Set the environment variables heroku config:set PORT=8080 Heroku clone the app from created path. heroku git:clone…

How I store server logs in Google Spreadsheets

Disclaimer: I'm not an expert in this field. I just want to share my experiences with logs, you are welcome to give some feedback on my method. I like logs, I hate logs. I like analyzing them but I don't like dealing with backups and everything. I have small sized…