- find package that belong to file
dpkg -S /path/to/file
- find application that listen port 4200
lsof -i :4200
sed -i -- 's/foo/bar/g' directory/*
find . -type f -exec sed -i 's/foo/bar/g' {} +
echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
git branch --no-merged
git branch --merged
git branch -D <name>
git reset --hard origin/<branch> # then local branch is identical to origin/branch
git stash show "stash@{0}" -p > name.patch
git apply name.patch
- changer les messages dans l'historique (le 8 indique le nb de commits)
git log --pretty=format:"%h %s" HEAD~8..HEAD
git rebase -i HEAD~8
>ici il faut modifier les lignes qu\'on souhaite éditer: pick=>edit, ensuite on sauve
git commit --amend
git rebase --continue
git stash
git checkout other-branch
git stash pop
Consider using git stash to temporarily store uncommitted work. So, for example, if I find myself working on the wrong branch - I may run the following sequence of commands.
git stash
git checkout <correct_branch>
git stash apply
git reflog
0cf1172 HEAD@{0}: commit: new version 08.2016
e6737c2 HEAD@{1}: commit: new release, optimise product rendering
10e2192 HEAD@{2}: checkout: moving from select_products_by_date to develop
If the commit you want to get rid of was the last commit, and you have not done any additional work you can simply use,
git reset HEAD~1
git reset HEAD^2
git reset --hard|--soft HEAD~1
- ~2 means up two levels in the hierarchy, via the first parent if a commit has more than one parent
- ^2 means the second parent where a commit has more than one parent (i.e. because it's a merge)
- --hard , --soft explanation, http://stackoverflow.com/a/3528483/680373
ffmpeg -i in.avi -vcodec copy -acodec copy -ss 01:06:13 -t 00:01:03 out.avi
mongodump -h <host>:27017 -d <db> -u <user> -p <password> -o path/to/
mongorestore (--drop) -h <host>:27017 -d <db> -u <user> -p <password> karibou-prod/
sudo curl -L https://yt-dl.org/latest/youtube-dl -o /usr/bin/youtube-dl`
youtube-dl -F https://www.arte.tv/fr/videos/071465-002-A/aux-origines-des-civilisations-2-4/
youtube-dl -f HTTPS_EQ_1 https://www.arte.tv/fr/videos/071465-002-A/aux-origines-des-civilisations-2-4/