sudo curl -sL https://github.com/docker/compose/releases/download/$(curl -is https://github.com/docker/compose/releases/latest|grep Location|awk -F/ '{print $NF}'|grep -Po '[0-9.]+')/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose ; sudo chmod +x /usr/local/bin/docker-compose ; docker-compose -v
docker-compose -v ; sudo rm /usr/local/bin/docker-compose ; sudo curl -sL https://github.com/docker/compose/releases/download/$(curl -is https://github.com/docker/compose/releases/latest|grep Location|awk -F/ '{print $NF}'|grep -Po '[0-9.]+')/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose ; sudo chmod +x /usr/local/bin/docker-compose ; docker-compose -v
Solution 1 (recommended)
Apple updated its Technical Notes to indicate that since 10.12.2, macOS includes version 7.3p1 of OpenSSH and its new behaviors.
In ~/.ssh create config file with the following content:
Host * (asterisk for all hosts or add specific host)
AddKeysToAgent yes
UseKeychain yes
IdentityFile (e.g. ~/.ssh/userKey)
cela suffit
cela ne suffit pas
cela a suffi
cela n'a pas suffi
when you are bored doing docker exec -ti foo bash
Create a new key shortcut
alt + shit + ;
send escape sequence + "."
Pour binder par defaut sur 127.0.0.1
/etc/docker/daemon.json → "ip": "127.0.0.1"
via Doo
find . -printf "%T@ %Tc %p\n" | sort -n
printf arguments from man find:
%Tk: File's last modification time in the format specified by k.
@: seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.
c: locale's date and time (Sat Nov 04 12:02:33 EST 1989).
%p: File's name.
docker system df
docker system prune
docker system prune --all
docker volume prune
Add this to your user's ~/.gitconfig under [alias] to make it globally available:
lsch = "!f() { git diff --name-status -r "HEAD~$1"; }; f"
You can invoke this to retrieve all affected files in the last 7 commits like so:
$ git lsch 7
31
down vote
accepted
Both forms are valid. However, for an API, I would recommend the second form. The reason is that it gives you a path for expansion of your API.
For example, if you have an API getUsersInGroup which returns an array of user objects, and later you decide you want to include, say, some aggregate statistics about the users being returned, there's no easy way to do that without breaking existing clients (or including lots of redundant data in each user object). If you use an object, you simply add another field to the object which is silently ignored by clients on a previous version of the API.
In short, try to avoid top-level primitives wherever possible in your API, and you'll find it easier to expand in the future.
Today I worked with an app storing its key not into the default 'database/namespace' in redis.
(default is 0)
The app stores into 12. So I had to 'select 12' before being able to query keys
interessant, ça a l'air sympa comme job!
TIL : strings command
Create SHA512 passwords
mkpasswd -m sha-512 password1
mkpasswd -m sha-512 password2
Edit /etc/haproxy/haproxy.cfg
userlist UsersFor_Ops
group AdminGroup users userone,usertwo
user userone password $6$yMgsow58.g/Z$mBjHfdVzqcF/LN.iwV23Eyqg.yGPTsp9pOwaStsJ6c4I4zL7BhucVVAkv5guf7OVRr8Pw0mHF4NrWBRCG5ci7/
user usertwo password $6$RZ86vRkQ$aRKN1HOsk6bDHBbMhS7jSo/p1NGFl4PvwY3KpU.72i./LvITi41nL84EkxOFXl.6Bmhynj/L7pYbfF0rUHtOB0
...
backend myserver
mode http
server myserver 1.1.1.1:80
acl AuthOkay_Ops http_auth(UsersFor_Ops)
http-request auth realm MyAuthRealm if !AuthOkay_Ops
Instead of using -f or --force developers should use
--force-with-lease
Why? Because it checks the remote branch for changes which is absolutely a good idea. Let's imagine that James and Lisa are working on the same feature branch and Lisa has pushed a commit. James now rebases his local branch and is rejected when trying to push. Of course James thinks this is due to rebase and uses --force and would rewrite all Lisa's changes. If James had used --force-with-lease he would have received a warning that there are commits done by someone else. I don't see why anyone would use --force instead of --force-with-lease when pushing after a rebase.
Good to know because it hurts me so bad:
When doing a put/post request with requests library, if the response is a redirect, request do the request again BUT with GET method...
-,-
My /var/lib/docker folder was non empty (12GB) event after big cleanup (containers, images, volumes..)
It's a known issue with some layers not removed when you do docker rm -f (force)
Solution : service docker stop; rm -rf /var/lib/docker/*; service docker start
:-/
The easiest way is to just convert the text file to utf-8 and pipe that to grep:
iconv -f utf-16 -t utf-8 file.txt | grep query
The operational attributes contained in an entry can be returned by ldapsearch by:
Explicitly listing them
ldapsearch -x -h host:port -b c=au "(oc=*)" createTimestamp modifyTimestamp
Or by returning all of them with the special + character
ldapsearch -x -h host:port -b c=au "(oc=*)" +
Or all attributes including operational attributes can be returned by including "*" +
ldapsearch -x -h host:port -b c=au "(oc=*)" "*" +
%{VARNAME}o The contents of VARNAME: header line(s) in the reply.
%{VARNAME}i The contents of VARNAME: header line(s) in the request sent to the server.