Asar

Asar electron “tarball” # Open terminal and install asar node module globally $ npm install -g asar # Go into the app’s directory, in our case it’s Slack $ cd /Applications/Slack.app/Contents/Resources # Create a directory to paste the content of app $ mkdir example-sourcecode # Unpack the app.asar file in the above directory using asar… Continue reading Asar

Redux, Selectors

Always use a selector to get state from components. export const getAudio = (state) => { return { audio_folder: state.audio_folder, playing: state.playing } }

Published
Categorized as Coding, Redux

.bat file to remove unused drivers files and more

This is the code for the .bat file to clean DriverStore folder in Windows @echo off for /L %%A in (1,1,300) do ( echo Deleting OEM%%A.INF pnputil /d OEM%%A.INF ) Clean the WinSxS folder, run these command in cmd (Admin) Dism.exe /online /Cleanup-Image /StartComponentCleanup Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase Dism.exe /online /Cleanup-Image /SPSuperseded

Published
Categorized as Windows

Raspberry turn off usb ports

download this https://github.com/codazoda/hub-ctrl.c You can control the power on a port using the following command. (I installed it in user bin directory) sudo $HOME/bin/hub-ctrl -h 1 -P 2 -p 1 That says to control hub 3 (-h 3) port 1 (-P 1) and to turn the power off (-p 0). You can also use ”-p… Continue reading Raspberry turn off usb ports

Raspberry: upload Arduino sketch from CLI

install these packages sudo apt-get install arduino-core arduino-mk Then add yourself to the dialout group to allow you to upload code to the Arduino board sudo usermod -a -G dialout pi (Change pi to be your username if different) Create Makefile ARDUINO_DIR = /usr/share/arduino BOARD_TAG = uno ARDUINO_PORT = /dev/ttyACM* ARDUINO_LIBS = include /usr/share/arduino/Arduino.mk to… Continue reading Raspberry: upload Arduino sketch from CLI

Lineage OS

Folder for downloaded updates /data/lineageos_updates

Published
Categorized as Android

Docker useful commands

View logs of a container docker logs -f CONTAINER List all containers (only IDs) docker ps -aq Stop all running containers docker stop $(docker ps -aq) If you want also to delete containers & images do the following steps, otherwise stop here. Remove all containers docker rm $(docker ps -aq) Remove all images docker rmi… Continue reading Docker useful commands

Published
Categorized as Coding