Blog et Aide mémoire informatique

vendredi 1 février 2019

Monitor progress on copy DD command

When you use dd copy,
dd if=/dev/xvdf of=/dev/xvdg bs=4096 
just monitor progress this way.
watch -n5 'sudo kill -USR1 $(pgrep ^dd)'
Some more fancy progress tools : https://www.cyberciti.biz/faq/linux-unix-dd-command-show-progress-while-coping/

vendredi 18 janvier 2019

Root User Name AMI on AWS

et the default user name for the AMI that you used to launch your instance
For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.

For a Centos AMI, the user name is centos.

For a Debian AMI, the user name is admin or root.

For a Fedora AMI, the user name is ec2-user or fedora.
For a RHEL AMI, the user name is ec2-user or root. For a SUSE AMI, the user name is ec2-user or root. For an Ubuntu AMI, the user name is ubuntu. Otherwise, if ec2-user and root don't work, check with the AMI provider.

vendredi 11 janvier 2019

Using Mapping into Cloudformation, and openapi Yaml

How to declare a mapping in your cloudformation and use it in your Linked openapi.yml file

Lire la suite

mercredi 26 décembre 2018

Docker PostgreSQL

Start the Docker
docker run --rm   --name pg-docker 
-e POSTGRES_PASSWORD=docker 
-d -p 5432:5432 
-v $HOME/docker/volumes/postgres:/var/lib/postgresql/data  postgres
List Database
SELECT datname FROM pg_database
WHERE datistemplate = false;
List Schema
SELECT schema_name FROM information_schema.schemata;
List Tables
SELECT * FROM pg_catalog.pg_tables
List tables schema
SELECT column_name, data_type, character_maximum_length
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = '';
Initial Source : Git Link source

jeudi 17 mai 2018

Convert SVN to Git

- Get repositotry Commiters
svn log -q https://yourRepoUrl | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
- Checkout / Convert To Git
git svn --authors-file=authors-transform.txt clone https://yourRepoUrl   --trunk=trunk --branches=branches --tags=tags
- List all branch
git branch -a
- Checkout the Branch Localy
git checkout remotes/origin/v2
git checkout master
-Create Local Branch From Remote Branch
git branch v2 remotes/origin/v2
-Push Publish on Github
git remote add origin https://user@gitRepos/theGitProject.git
git push -u origin master
git push --all
git push --tags

mardi 19 décembre 2017

Nice link with time function

https://wiki.archlinux.org/index.php/time

mercredi 13 septembre 2017

Remove from boot Linux

update-rc.d -f mongodb remove
chkconfing

mardi 2 mai 2017

Add Address to IPTABLE DROP

Block a region. Usefull for China.
iptables -A INPUT -s 202.109.0.0/16 -j DROP

Add Address to IPTABLE DROP

Block a region. Usefull for China.
iptables -A INPUT -s 202.109.0.0/16 -j DROP

samedi 6 février 2016

Inodes

List inodes of mounted device
df -i
List inodes for directory
ls -id
find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n

mercredi 2 décembre 2015

Hardware monitoring

Install this tool ipmitool few command Print system event log
ipmitool sel list
ipmitool 

lundi 23 novembre 2015

Logrotate

Some tips on logrotate

Lire la suite

mercredi 27 mai 2015

Network Config + Proxy : Fast Facts

Some quick reminder of file to modify

Lire la suite

mercredi 14 janvier 2015

Mail : interesting short cut

list mail queue
mailq  | tail -1 | awk '{print $5}'
See detail of queue
qshape
Flush mail queue
postfix -f
Flush defered mail queue
postsuper -d ALL deferred

dimanche 11 mai 2014

BBox DNS

Copy/Paste of this URL, in case of this page will be removed. Link

Lire la suite