Lzdev. I'm lazy lazy ...very lazy dev ..!!

Categories:

Copyright by Lzdev

DevOps

Useful docker commands for everyday use!

Below is a collection of useful docker commands that I use often Run a docker compose, remember cd to the directory containing the compose file before running docker-compose up Run and rebuild docker compose docker-compose up --build List runing container docker ps List all container docker ps -a Remove image docker rmi [image-id] Stop container docker stop [container-id]

Read more...

Useful git commands for everyday use!

- Init git project: git init Clone repo from link git clone [link] - View remote git remote - Save username, password git config credential.helper store - Update code and write to local file  git pull - Pull new code but not write to file. git fetch - Switch branch git fetch origin <----this will fetch the branch git checkout branch_name <--- Switching the branch - Rename branch: Rename your local branch.…

Read more...

Block any https website in route with iptables on DD-WRT router

Here is how I was able to do this: (1) Find out all the IP space that belongs to Facebook ---(a) Google'd for Facebook's BGP AS number -> AS32934 ---(b) Looked up all the routes for AS32934 on as.robtex.com ---(c) Self aggregated all the IP space. (2) Build a set of rules in IPTABLES that: ---(a) Define the FB destinations ---(b) Define the local sources ---(c) can be triggered into use based on a cron schedule. In order to use this configuration, there are some pr…

Read more...

Automate tasks with crontab

- Setup yum install cronie - Start crontab and automatically run every reboot: service crond start chkconfig crond on - Some commonly used commands: crontab -e: create or edit crontab file crontab -l: show crontab file crontab -r: remove crontab file - Structure of crontab file has 5 timed fields, finally the command will be run periodically, the structure is as follows: * * * * * command to be executed - - - - - | …

Read more...

Gitlab Runner and useful tips

Gitlab Runner is CI/CD tool for Gitlab

Read more...