Nguyen Sy Thanh Son

Search

Primary Menu

Skip to content
  • Shop

#July 2017

Linux

NGINX – redirect location by cookies

July 20, 2017 Nguyen Sy Thanh Son
4

Just add if condition to your Nginx configuration file as the below:

1
2
3
4
5
6
    location ~ ^/$ {
        if ($http_cookie ~* "your_key=your_val") {
            return         302 https://example.com;
        }
        proxy_pass http://your_service;
    }

 

nginx

Nguyen Sy Thanh Son

4
July 20, 2017 Nguyen Sy Thanh Son

Docker

Clean Hard Disk – Docker Containers On Ubuntu

July 20, 2017 Nguyen Sy Thanh Son
1

I find that Ubuntu disk space is eaten up heavily by keeping old kernels around.

Just do this:

1
2
apt-get autoclean
apt-get autoremove

And:

1
docker system prune

(this can take a while, maybe 5 minutes? it has to iterate through all the old kernels and remove all of them.)

docker

Nguyen Sy Thanh Son

1
July 20, 2017 Nguyen Sy Thanh Son

Recent Posts

  • I hacked Parity MultiSig Wallet in Ropsten Testnet
  • How to get started building an ICO Smart Contract
  • Download M3U8 Video by FFMPEG command
  • Get started Ethereum/Solidity ICO Smart Contract
  • NGINX – redirect location by cookies
  • Clean Hard Disk – Docker Containers On Ubuntu
  • Logstash Elasticsearch data retention
  • My First AI Application
  • How to HOT Backup Database (MongoDB, MySQL, ES …) to AWS S3
  • Connect USB from Virtual Machine using Vagrant and Virtual Box

Archives

  • November 2017
  • October 2017
  • September 2017
  • July 2017
  • April 2017
  • March 2017
  • February 2017
  • December 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014

Categories

  • AngularJS
  • Blockchain
  • Docker
  • GIT
  • IoT
  • Linux
  • NodeJS
  • Others
  • Phonegap
  • PHP
  • Python
  • Uncategorized
  • VIM

Find me at

  • Twitter
  • Github
  • Stackoverflow
  • LinkedIn
  • Facebook
  • Google+

AngularJS

  • Starting a Miroservices Project with NodeJS and Docker
  • Upload images using AngularJS and NodeJS
  • Starting to build a Admin Site with AngularJS and NodeJS
  • CasperJS test lazyload
  • AngularJS, Set Image always in the center of DIV
  • See more ...

Blockchain

  • I hacked Parity MultiSig Wallet in Ropsten Testnet
  • How to get started building an ICO Smart Contract
  • Get started Ethereum/Solidity ICO Smart Contract
  • See more ...

Docker

  • Clean Hard Disk – Docker Containers On Ubuntu
  • How to HOT Backup Database (MongoDB, MySQL, ES …) to AWS S3
  • Starting a Miroservices Project with NodeJS and Docker
  • Install Docker and Docker Swarm on CentOS7
  • Centralize Nginx Logs with FluentD, Kibana and Elasticsearch
  • See more ...

GIT

  • Delete a commit from branch in Git
  • GIT – Keep files when merge conflict
  • Vim install Vumdle
  • Writing shell script to deploy changed file via ftp
  • Working with branch in GIT
  • See more ...

IoT

  • Connect USB from Virtual Machine using Vagrant and Virtual Box
  • I start studying Internet of Things
  • See more ...

Linux

  • Download M3U8 Video by FFMPEG command
  • NGINX – redirect location by cookies
  • Logstash Elasticsearch data retention
  • How to HOT Backup Database (MongoDB, MySQL, ES …) to AWS S3
  • Connect USB from Virtual Machine using Vagrant and Virtual Box
  • See more ...

NodeJS

  • Starting a Miroservices Project with NodeJS and Docker
  • Upload images using AngularJS and NodeJS
  • How to upload files with NodeJS and ExpressJS 4
  • Starting to build a Admin Site with AngularJS and NodeJS
  • Combines all swagger documents in microservices
  • See more ...

Others

  • Install Cloudera Hadoop in Ubuntu 14.04
  • What management tools we should use for a start-up business?
  • See more ...

Phonegap

  • Update NPM to latest version
  • CasperJS test lazyload
  • AngularJS and Scroll lazy load directive
  • Store data to SQLite in AngularJS PhoneGap
  • Fix “Position Fixed” in Phonegap IOS App
  • See more ...

PHP

  • Install XHProf in Ubuntu 14.04
  • How to integrate phpCAS in Laravel
  • WordPress updates directly without FTP
  • Adding external library to Laravel 4+
  • MYSQL Command should remember
  • See more ...

Python

  • My First AI Application
  • Send SMS from Raspberry Pi with USB 3G
  • Upload and Download files from AWS S3 with Python 3
  • Run a Flask application in Nginx uwsgi
  • A simple examle for Python Kafka Avro
  • See more ...

Uncategorized

  • How to add SSH Keys to CoreOS
  • See more ...

VIM

  • Vim install Vumdle
  • [.vimrc] Add key map to comment out your code
  • See more ...
  • I hacked Parity MultiSig Wallet in Ropsten Testnet

    Parity MultiSig Wallet was hacked in 7 November 2017 (see the details here https://paritytech.io/blog/security-alert.html). The hack destroyed 1% of Ethereum’s […]

  • How to get started building an ICO Smart Contract

    ICO (Initial Coin Offering) is a new way to raise fund for startups.  There are many steps we have to […]

  • Download M3U8 Video by FFMPEG command

    Use command:

    1
    ffmpeg -i "720.m3u8" -c copy video.mp4

    If you got an error:

    1
    [http @ 0x2d51880] Protocol not on whitelist 'file,crypto'!

    We use command:

    1
    ffmpeg -protocol_whitelist "file,http,https,tcp,tls" -i "720.m3u8" -c copy video.mp4

         

  • Get started Ethereum/Solidity ICO Smart Contract

    The below is commands when I start to learn Ethereum/Solidity . Assume that we installed Geth and Solidity Compiler in […]

  • NGINX – redirect location by cookies

    Just add if condition to your Nginx configuration file as the below:

    1
    2
    3
    4
    5
    6
        location ~ ^/$ {
            if ($http_cookie ~* "your_key=your_val") {
                return         302 https://example.com;
            }
            proxy_pass http://your_service;
        }

     

  • Clean Hard Disk – Docker Containers On Ubuntu

    I find that Ubuntu disk space is eaten up heavily by keeping old kernels around. Just do this:

    1
    2
    apt-get autoclean
    apt-get autoremove

    And:

    1
    docker system prune

    […]

  • Logstash Elasticsearch data retention

    If you are using Elasticsearch to centralize your log data, that is a great solution. However, after few months, you […]

  • My First AI Application

    I am not Data or AI scientist, I am just a Developer. I tried to learn AI in my free […]

  • How to HOT Backup Database (MongoDB, MySQL, ES …) to AWS S3

    Actually, there are many way to backup your database. You can using RSYNC, MongoDump for Mongo, S3 Backup Plugin for […]

  • Connect USB from Virtual Machine using Vagrant and Virtual Box

    Sometimes (e.g You are developing an IoT Project), you need to connect you board to Virtual Machine via USB Port. […]

DMCA.com Protection Status   © Nguyen Sy Thanh Son
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn