nscd -K; nscd
google-chrome-stable --app=https://obs.ninja/?view=Abcd123 --user-data-dir=/tmp --kiosk
# Minify JS
npx terser -o app.min.js app.js common.js
# Minify CSS
npx clean-css-cli -o style.min.css css/bootstrap.css style.css
# Minify HTML
npx html-minifier index-2.html -o index.html --remove-comments --collapse-whitespace
# XML
npx pretty-data-cli --type xml --minify input.xml > input.min.xml
Press Enter
, then ~
, then .
. (In some languages, you may need to press Shift
or Alt
to enter the ~
character.)
mkdir -p /destination/$(pwd | awk -F'/' '{print $NF}')
cp -r !(node_modules) /destination/$(pwd | awk -F'/' '{print $NF}')
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
The -prune
option skips child node_modules
directories so that only top level node_modules
are removed, for better performance.
# best time/compression ratio in parallel
tar --use-compress-program="pigz -4 " -cf my.tar.gz ./file1 ./file2 ./directory
# best performance parallel decompression
tar --use-compress-program=pigz -xf my.tar.gz
# compress current directory properly
tar --exclude=mydir.tar.gz --use-compress-program="pigz -4 " -cf mydir.tar.gz * .??*
find . -type f | wc -l
Add a line akin to the following in /etc/exports
:
/Users/myuser/Documents/MySharedDir -maproot=myuser:mygroup -alldirs localhost 192.168.0.104
The previous example shares directory MySharedDir
and all sub-directories with clients localhost
and 192.168.0.104
.
The -maproot=myuser:mygroup
maps the root
user in the client to be the myuser:mygroup
user:group combo when creating/saving files. The -maproot
option could be switched out for -mapall
which as its name implies would map all connected users to the local user:group specified, but that's not very safe.
Once saved, run the following to restart NFS server daemon:
sudo nfsd restart
And verify your shares:
showmount -e
Test if xev
installed
xev
Should open a little key and mouse capture window and output the captured events on terminal.
If xev
not found install x11-utils
:
sudo apt-get install x11-utils
With xev running take note of mouse button numbers and key names you want to map.
Install xbindkeys
and xautomation
:
sudo apt-get install xbindkeys xautomation
Create the xbindkeys config file using:
xbindkeys --defaults > ~/.xbindkeysrc
Next we need to add the key/button bindings to the config file ~/.xbindkeysrc
:
## Map mouse button 6 to "move workspace right" key combination
"xte 'keydown Alt_L' 'keydown Control_L' 'keydown Right' 'keyup Right' 'keyup Control_L' 'keyup Alt_L'"
b:6
## Map mouse button 2 to "move workspace left" key combination
"xte 'keydown Alt_L' 'keydown Control_L' 'keydown Left' 'keyup Left' 'keyup Control_L' 'keyup Alt_L'"
b:2
Finally apply changes:
xbindkeys -p
Edit ~/.Xmodmap
file and make the pointer
mapping the following:
pointer = 1 2 3 5 4 6 7 8 9 10 11 12
NOTE: The 4 and 5 are out of sequence, basically telling xmodmap to reverse vertical scrolling "buttons". To reverse horizontal scrolling 6 and 7 should be switched as well.
Reload xmodmap:
xmodmap ~/.Xmodmap
Copy fonts (within their own aptly named folders) to this path:
/usr/share/fonts
The following clears the font cache:
fc-cache -fv
apt-get --purge remove -y mariadb-server
apt-get --purge remove -y "mysql*"
rm -rf /etc/mysql/
chmod -R u+rwX,go-rwx ~/.ssh
On MacOS machine make sure shared folder has windows sharing turned on and on Finder view folder info and check share
.
Then on Manjaro install:
pamac install thunar-shares-plugin-gtk3
and run:
sudo mount -t smb3 //mac.local/shared-folder /mnt/shared-folder -o user=...,pass=...,nounix,uid=...,gid=...,file_mode=0777,dir_mode=0777
# /etc/X11/xorg.conf.d/00-keyboard.conf
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us"
Option "XkbModel" "pc105"
Option "XkbVariant" "mac"
Option "XkbOptions" "altwin:ctrl_alt_win,compose:ralt"
EndSection
KDE Plasma (kcm_keyboard
to be specific) adds it's own mapping on top of X11 / Xorg, so this is a two step process.
First create ~/.Xmodmap
file with contents:
keycode 64 = Control_L
keycode 133 = Alt_L
remove mod1 = Meta_L
Then go to System Settings -> Input Devices -> Keyboard -> Advanced, make sure Configure Keyboard Options is checked and within the list make sure that Ctrl is mapped to Alt; Alt is mapped to Win option is also checked.
Logout and then log back-in.
docker ps -a
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker volume ls
docker volume prune
docker images -a
docker rmi $(docker images -a -q)
docker system prune -a
# Create credentials
export MONGO_USER=mongoadmin
export MONGO_PASS=$(openssl rand -base64 32)
# Start
docker run -d --name quick-mongo \
-e MONGO_INITDB_ROOT_USERNAME=$MONGO_USER \
-e MONGO_INITDB_ROOT_PASSWORD=$MONGO_PASS \
-p 27017:27017 \
mongo
printf "\nUser: $MONGO_USER\nPassword: $MONGO_PASS\n\n"
# Stop
docker kill quick-mongo && docker rm quick-mongo
if pgrep -x "ssh-agent" > /dev/null
then
echo "Agent is running..."
else
eval `ssh-agent`
fi
aws iot create-authorizer \
--authorizer-name <LAMBDA-NAME> \
--authorizer-function-arn <LAMBDA-ARN> \
--status ACTIVE \
--signing-disabled
aws lambda add-permission --function-name <LAMBDA-NAME> --principal iot.amazonaws.com --source-arn <AUTHORIZER-ARN> --statement-id <RANDOM-UID> --action "lambda:InvokeFunction"
aws iot test-invoke-authorizer --authorizer-name <LAMBDA-NAME> \
--mqtt-context '{"username": "the_user_name", "clientId":"unique_device_id"}' \
--http-context '{"headers": {"token": "the_token"}}'