aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2020-10-04 22:25:33 +0200
committerneodarz <neodarz@neodarz.net>2020-10-04 22:25:33 +0200
commit9443eb4006a06bc3d9a2ac3d5339ac394d2c5c6e (patch)
tree864670655f9bd3d521410dd24fa14b002ab3c81c
parent8b4e51ffa979c10e37d7ba3d7957184b751c2db7 (diff)
downloaddotfiles-9443eb4006a06bc3d9a2ac3d5339ac394d2c5c6e.tar.xz
dotfiles-9443eb4006a06bc3d9a2ac3d5339ac394d2c5c6e.zip
Update some cheat
Diffstat (limited to '')
-rw-r--r--dotfiles/cheat/docker5
-rw-r--r--dotfiles/cheat/gpp3
-rw-r--r--dotfiles/cheat/image28
-rw-r--r--dotfiles/cheat/mongodb11
-rw-r--r--dotfiles/cheat/sphinxdoc24
-rw-r--r--dotfiles/cheat/vim2
6 files changed, 73 insertions, 0 deletions
diff --git a/dotfiles/cheat/docker b/dotfiles/cheat/docker
index 86187f5..12b572a 100644
--- a/dotfiles/cheat/docker
+++ b/dotfiles/cheat/docker
@@ -42,3 +42,8 @@ DO: echo N | sudo tee /sys/module/overlay/parameters/metacopy
# command for launch GUI soft, sometimes custom Dockerfile is needed
--user $UID -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix <container_name>
+
+# Remove shit
+for image in $(docker images | grep "^<none>" | awk '{print $3}'); do docker rmi $image; done
+# in case there is no important data in volumes:
+sudo rm -rf /var/lib/docker/volumes
diff --git a/dotfiles/cheat/gpp b/dotfiles/cheat/gpp
new file mode 100644
index 0000000..de45408
--- /dev/null
+++ b/dotfiles/cheat/gpp
@@ -0,0 +1,3 @@
+Export secret key
+
+gpg --export-secret-keys -a <keyid> > secret.asc
diff --git a/dotfiles/cheat/image b/dotfiles/cheat/image
new file mode 100644
index 0000000..c531f16
--- /dev/null
+++ b/dotfiles/cheat/image
@@ -0,0 +1,28 @@
+# Prepare image for the web with gimp
+
+Resources:
+- https://docs.gimp.org/en/gimp-using-web.html
+- https://logosbynick.com/gimp-reduce-file-size-png/
+
+## Optimize color palette
+
+Image > Mode > Indexed
+
+Check generate optimum palette with 35 value (255 is the default) then click on
+Convert
+
+## Lower resolution
+
+Image > Scale
+
+Set witch to 700 and then click on Scale
+
+## Remove alpha chanel
+
+Remove Alpha channel by flattering the image (Image -> Flatten Image)
+
+## Save
+
+Save in PNG format with uncheck all and best compression
+
+Don't forget to check if the final image is ok with what you want
diff --git a/dotfiles/cheat/mongodb b/dotfiles/cheat/mongodb
index 54b8652..d7a7d42 100644
--- a/dotfiles/cheat/mongodb
+++ b/dotfiles/cheat/mongodb
@@ -1,10 +1,21 @@
+# Admin user full
+use admin
+db.createUser({user:"admin", pwd:"admin", roles: ["userAdminAnyDatabase", "clusterAdmin", "dbAdminAnyDatabase"]})
+
+# list all dbs users
+db.system.users.find()
+
# Create user, don't forget to use the correct database
use <db_name>
db.createUser({user:"root", pwd:"root", roles: ["readWrite"]})
# Create use in another database:
+use madbtest
db.createUser({user:"admin", pwd:"vIhVPwy81sdf5fPt3a2", roles: [{role: "readWrite" , db: "madbtest"}]})
+# udpate pwd
+db.updateUser("username", {pwd: ""})
+
# mongoshell get schema collection
# Source: https://medium.com/@ahsan.ayaz/how-to-find-schema-of-a-collection-in-mongodb-d9a91839d992
diff --git a/dotfiles/cheat/sphinxdoc b/dotfiles/cheat/sphinxdoc
new file mode 100644
index 0000000..3e081d7
--- /dev/null
+++ b/dotfiles/cheat/sphinxdoc
@@ -0,0 +1,24 @@
+# Add a strike html component
+
+In conf.py file:
+
+```
+rst_prolog = """
+.. role:: strike
+"""
+```
+
+Extend the layout theme template `layout.html` with:
+
+```
+{% extends "!layout.html" %}
+{% set css_files = css_files + ["_static/style.css"] %}
+```
+
+In the `style.css`:
+
+```
+.strike {
+ text-decoration: line-through;
+}
+```
diff --git a/dotfiles/cheat/vim b/dotfiles/cheat/vim
index 5c14dae..e6416bb 100644
--- a/dotfiles/cheat/vim
+++ b/dotfiles/cheat/vim
@@ -85,6 +85,8 @@ And save it in a better name: `:WorkspaceSave {name}`
:set foldmethod=indent foldlevel=1
za # toggle indent
+:w !sudo tee %
+
# spellchecking
`:set spell`
``:set spelllang=fr`