Category: blog

  • How to get Github Vanity url through Git.io?

    If your Github user name is already taken by somebody (I typically choose thiru, but taken by somebody, so I had to choose ithiru). But if you want to share the url with others and still want to use thiru, you can do it through Github url shortener Git.io.

    Use the following command and you should be able to get it. Please do not try the web version @ git.io, it will auto generate and if you try to do it again through command line it will return the same shortened url.

    -F "code=vanity"

    will make sure you get the custom url rather than generated one.

    $ curl -i https://git.io -F "url=http://ift.tt/2dlQJi3" -F "code=thiru"
    HTTP/1.1 100 Continue
    
    HTTP/1.1 201 Created
    Server: Cowboy
    Connection: keep-alive
    Date: Thu, 22 Sep 2016 05:05:35 GMT
    Status: 201 Created
    Content-Type: text/html;charset=utf-8
    Location: https://git.io/vi76a
    Content-Length: 25
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    X-Frame-Options: SAMEORIGIN
    X-Runtime: 0.256529
    X-Node: 27a81f0a-cb95-4f6d-94d6-0c9891e3714b
    X-Revision: 4fdc60de6311e6a3aa31e19bc7b3aad7e85d33a6
    Strict-Transport-Security: max-age=31536000; includeSubDomains
    Via: 1.1 vegur
    

    In case you by mistake tried @ https://git.io via Browser, you can try the anchor trick to fool git.io that the url is unique.

    $ curl -i https://git.io -F "url=http://ift.tt/2dlQJi3#start-of-content" -F "code=thiru"
    HTTP/1.1 100 Continue
    
    HTTP/1.1 201 Created
    Server: Cowboy
    Connection: keep-alive
    Date: Thu, 22 Sep 2016 05:12:47 GMT
    Status: 201 Created
    Content-Type: text/html;charset=utf-8
    Location: https://git.io/thiru
    Content-Length: 42
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    X-Frame-Options: SAMEORIGIN
    X-Runtime: 0.255721
    X-Node: 722fe806-9844-4265-9a8f-c51d2c170cf7
    X-Revision: 4fdc60de6311e6a3aa31e19bc7b3aad7e85d33a6
    Strict-Transport-Security: max-age=31536000; includeSubDomains
    Via: 1.1 vegur
    

    via Github Blog

    The post How to get Github Vanity url through Git.io? appeared first on thiru.

  • Jeyamohan’s Creations – Web App

    Writer Jeyamohan’s is a famour writer in Tamil Nadu, India. Bio at Wikipedia
    When I started reading his book(s) on the Indian Epic Mahabharata named ‘Venmurasu’ (வெண்முரசு), I was drawn towards it more deeply due to its artistic description of the events.

    But he was releasing one chapter each day and it was difficult for me to follow, I need to read the whole book in one stretch, that’s how I am wired. So I stopped reading and waited till he completes each book. Then I would read them all.

    While reading I found that the Venmurasu Website was based on wordpress blog and it was really not a good way to present a Novel, it just displays the chapter in reverse chronological order rather than the typical chapter flow of a book.

    I started thinking about screen scraping the content and present in Responsive Web Design, so it would easier for me to read on my Phone, Tablet or Desktop wherever I am.

    App Development

    Sep 2014 I had started doing screen scraping with Node.js app and UI using Node Express module.

    Screen Scraping

    • Navigating through the url
    • Extract the content using XPath with cheeio package
    • Extracted the chapter art image url, download and create create thumbnail and the full image after downloading
    • Persist the data into the tables by Book, Volume, Chapters

    UI Design

    As I wanted to read through various devices I wanted to use Responsive Web Design. Even though Twitter Bootstrap is very popular I went for Zurb Foundation as it just gives barebones and allows you to customize using the SASS variables. That also gives complete control over the design.

    But during designing the app, I didn’t customize the Zurb Foundation, just used it as it is by downloading the css/js files and put them under public and started designing the UI by hand coding the html and checking them on the browser.

    Only later I started using all the productivity tools like Gulp, Twig, SASS customizing, Browser Sync and others.

    Infinte Scroll

    I did the infinite scroll for two reasons, I can just hit the bottom of the each chapter to load the content of the next chapter few times which would cache the chapters on the browser so I can read them even if I am offline. And the other one to avoid number of clicks/taps the user needs to do to navigate and read, the chapters should load and ready for them to continue instead of they click/tap on the next link, wait for the page to load, that would distract the reading flow.

    Pre-requisite

    Get the Files

    Gitub Project

    git clone git@github.com:ithiru/jemo.git

    Data

    Before running the application, the website needs to be scrapped and loaded to database.

    Please load the data using the SQL available in the data folder.

    mysql -h <host> -u <user> -p <database> < data.sql

    .env

    Please create .env file under node-app folder with the following values to connect to MySQL instance where the data has been loaded.

    DB_HOST=<host>
    DB_USER=<user>
    DB_PASS=<password>
    DB_NAME=<db>
    

    How to Run the application

    
    git clone git@github.com:ithiru/jemo.git
    cd jemo/Docker
    docker build -t jemo .
    cd ..
    docker run -it --rm -v $HOME/jemo/node-app:/app --link mysql:mysql -p
    

    Screenshots

    iPhone 5

    iPhone5-Portrait

    iPhone 6

    iPhone6-Portrait

    iPhone 6+

    iPhone6Plus-portrait

    iPad

    iPad

    Mac Book Pro

    MacBookPro

    App Demo

    New UI

    New-UI

    The post Jeyamohan’s Creations – Web App appeared first on thiru.

  • Digital Ocean Setup with Dockers

    Digital Ocean Setup

    Dockers

    Digital Ocean setup using Dockers and Nginx to run my Blog and my friend’s and Ponniyin Selvan Community

    The day Dockers announced the Release Candidate and after reading about the application virutalization I could immediately sense the advantages related to isolating different applications and upgrade them without affecting other applications/components. Started experimenting it on Digital Ocean on May 26th 2014 and never looked back since then.

    Some of the advantages I found during my experiments

    • I am able to hide application instances to the public internet. For example, mysql is accessible only by the other Docker Containers
    • I have a wordpress blog which is bit old due to plugin dependency and doesn’t work properly in new PHP 5.4.x, so I had to use both old PHP and PHP 5.4+ at the same time. Docker allows me to create and run both without having to worry about conflicting dependency components and upgrades. I proxy to respective PHP Fast CGI docker instance based on the domain/blog.
    • I was able to switch from MySQL to MariaDB silently without even worrying as everything else including the Docker name is same (mysql!) but internally it is running MariaDB.
    • Able to run different Linux distributions on top of Ubuntu due to dependency of the component. Without dockers then I would have to provision another Digital Ocean droplet and install that particular OS.
    • Able to run multiple instances of the same Docker Image, upgrade and test and make sure the newer version of the application works before switching over to production mode.
    • Portable, when I upgraded from Ubuntu 14.04 to Ubuntu 15.10, I ran into some issues on the same Digital Ocean Droplet. I just created a new droplet with 15.10, exported the Docker Image from 14.04 Droplet and imported to the new Droplet. No need to go through all installation procedures again.
    • Can create multiple versions of the Image and switch between them.
    • Light weight/Less Memory/Cheaper than creating new VPS.

    Dockers Running

    Dockers-Running-Digital-Ocean

    Docker Images

    Docker-Images-Digital-Ocean

    Dockers running At Work

    Docker-Setup-At-Work

    Dockers Images At Work

    Docker-Images-At-Work

    Nginx

    When I started setting public websites with Dreamhost on 7th Dec 2006 they offered cheap hosting for $2 a month, it was shared hosting where you don’t get to run lot of apps due to memory/cpu restrictions. My websites were served using Apache Web Sever

    After my websites started creating some traffic, Dreamhost on 26th Dec 2008 sent a nice email stating that my websites consuming lot of CPU/RAM and better move to private server with some promotion. I took it and started using Lighttpd with some Lua scripting for couple of years.

    Finally moved to Nginx on 26th Jan 2010 and never looked at any other web server since then. Nginx is fast, consumes less memory and able to customize easily than Apache.

    When I was doing a POC for work to convert an existing Web application to Hybrid application, I had to use some Lua scripting at the Nginx layer to do Single Sign On. After that I started using Nginx from OpenRestry distribution which allows to have Lua scripting which allows me to do much more than just static configurations.

    Backup and alerts using IFTTT and Pushbullet

    Instead of sending/checking email to ensure that my backups are running, when does it start and ends. I am using IFTTT Maker Channel which in turn push the data to Pushbullet and PushBullet App on Android Phone shows Notification that it completed.

    I am creating daily Incremental backup with Day Name and Full Monthly backup with Month Name and Weekly back with Week number of the month. This will allow me to control how many backup file I create and don’t have to go and remove older backups.

    curl -X POST -H "Content-Type: application/json" -d '{"value1":"Starte","value2":"test","value3":"test"}' http://ift.tt/2bXpsVT
    DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    cd /data
    sudo tar -czvf backups/$(date '+%A').tar.gz .  --exclude=swap4G.swap --exclude=backups --listed-incremental=backups/data.snar
    sudo mv -f backups/$(date '+%A').tar.gz /backups/daily/
    curl -X POST -H "Content-Type: application/json" -d '{"value1":"Completed","value2":"test","value3":"test"}' http://ift.tt/2bXpsVT
    

    Screenshot_2016-09-07-15-32-14-088

    backup-schedule

    The post Digital Ocean Setup with Dockers appeared first on thiru.

  • Pivotal Certified Pivotal Cloud Foundry Developer!

    Successfully completed Pivotal Cloud Foundry Developer certification on 6th Sep 2016 through my Company STG.

    Pivotal Certified Pivotal Cloud Foundry Developer! - Thirumalai Veerasamy

    Pivotal Certified Pivotal Cloud Foundry Developer! – Thirumalai Veerasamy

    Web Delivery - Candidate

    Out of 32 questions I answered 25 questions correctly and 7 wrong answers.

    It is bit challenging as some of the answers are very close. 24 questions need to be answered out of 32 questions to clear the certification.

    I did the following to complete the certification, it took around 3-4 weeks of time as I could spend few hours every day with other office work.

    Exams Local Credit
    Exams Local Credit
    • Schedule the Exam by
      • Search for PCF-D and click ‘Next’
      • Provide the Date & Timezone
      • Check the time slot available, please check the screenshot below
    Exams Local Schedule
    Exams Local Schedule
    • Run the compatibility test and make sure all the checkboxes are ok except the 3rd Party Cookies, Webcam/Resolution. Which has to be done manually.
    • Make sure you login 15 mins before the test and work with Live Agent to go through certain checks to get ready.
    • Good Luck !

    The post Pivotal Certified Pivotal Cloud Foundry Developer! appeared first on thiru.

  • “யாரோ ஒருவன் என்று எப்படிச் சொல்வேன்” – தேவதேவன்.

    The post appeared first on thiru.

  • நான் இந்துவா?

    தெளிவான மையமும் அதைச்சார்ந்த அமைப்பும் கொண்டவை இருவகை மதங்கள். ஒன்று யூதமதம்போல இனமதங்கள். யூதம் என்பது ஒரு இனம். அந்த இனத்தவரின் நம்பிக்கையே யூதமதம். அதற்குப் பிற இனத்தவர் மதம் மாறமுடியாது. பல ஆப்ரிக்கக் குறுமதங்கள் இவ்வகைப்பட்டவை. இந்த மதங்கள் தெளிவான எல்லை வரையறை கொண்டவையாக இருக்கும். இனமதங்களின் எல்லை இன அடையாளமே. அதற்கு வெளியே உள்ளவர்கள் அவர்களைப் பொறுத்தவரை அன்னியர் அல்லது பிறர். இனமதங்கள் மதமாற்றம்செய்வதில்லை.

    இரண்டாவதாக தீர்க்கதரிசன மதங்கள். அந்த மதங்களை நிறுவிய தீர்க்கதரிசி அந்தமதத்தின் மையத்தையும் எல்லைகளையும் தெளிவாக வரையறைசெய்திருப்பார்.ஆபிரகாமிய மதங்களைப் பொறுத்தவரை ’நானே உண்மையான வழிகாட்டி, பிற எல்லாமே பொய்யனாவை’ என்ற வரியை தீர்க்கதரிசி சொல்லியிருப்பார், அல்லது சொன்னதாக எழுதப்பட்டிருக்கும். கிறிஸ்தவம், இஸ்லாம், மானிகேயன், பகாயி, அகமதியா மதங்களை இவ்வகையில்சேர்க்கலாம். இன்றும் இவ்வகை மதங்கள் தோன்றியபடியே உள்ளன

    இன்னொருவகை மதங்களைப் பொதுவாகத் தொகைமதங்கள் எனலாம். இந்துமதமே அதற்கு உலக அளவில் சிறந்த உதாரணம். ஜப்பானிய ஷிண்டோ மதம் சற்றே சிறிய ஒரு உதாரணம். இவை மையமான ஒரு தீர்க்கதரிசனமோ அல்லது மையமான ஒரு தத்துவமோ கொண்டவை அல்ல. இவை ஒரு குறிப்பிட்ட வரலாற்றுச்சூழலால் உருவாகி வளர்ந்துகொண்டிருக்கின்றன.

    The post நான் இந்துவா? appeared first on thiru.

  • How You’re Sabotaging Your Creativity Every Day

    It’s pretty easy to stuck in a comfort zone where you’re not experiencing anything new. While that’s helpful for efficiency, it kills your creativity in all kinds of ways. When you stick within your comfort zone, you also tend to isolate yourself off from the rest of world. When you do that, you’re not creating new experiences, meeting new people, experiencing new cultures, or challenging yourself. This kills your creativity quicker than you might think.

    How You’re Sabotaging Your Creativity Every Day

    The post How You’re Sabotaging Your Creativity Every Day appeared first on thiru.

  • We Want Net Neutrality in India!

    You need to send a mail to TRAI mail id advqos@trai.gov.in in support of net neutrality and against differential pricing/speeds

    If TRAI does not get enough public mails in support of Net Neutrality, this is what you can expect:-

    You will have different packages for accessing internet.

    1 GB data for Rs 252 + Rs 50 for Google + Rs 25 for facebook and so on.
    1 GB data pack would be like the base pack of your DTH.
    But you will have to add packs for carrier decided pricing to be able to use all apps.

    Isn’t this SCARY? Its just the start!

    For more details – http://ift.tt/1xjmdMS

    Net Neutrality

    The post We Want Net Neutrality in India! appeared first on thiru.