Skip to main content

6 posts tagged with "how to"

View All Tags

· One min read
Hreniuc Cristian-Alexandru

I usually have a data folder in my home folder, where I keep all my data, including the cache of my browser.

When I switch PCs I have to copy that folder on my new pc, if I try to archive the folder it will create a corupted compressed archive or the compression will fail.

So, to fix this I had to follow the following steps:

# Create a copy of the folder with rsync
# Will copy all folders/files from `data` inside the `data_backup` folder
sudo rsync -a --info=progress2 /home/chreniuc/data/ /home/chreniuc/data_backup/

# Create an archive
tar -cf - data_backup | lz4 -c > data_backup_29.04.2022.tar.lz4

# Copy the archive where you want

cp data_backup_29.04.2022.tar.lz4 destination

# To uncompress a lz4
lz4 -dc --no-sparse data_backup_29.04.2022.tar.lz4 | tar xf -

· One min read
Hreniuc Cristian-Alexandru

Start up Thunderbird, open the Config Editor (Tools -> Options -> Advanced -> General -> Config Editor), and change the mail.server.default.check_all_folders_for_new setting to true.

Or in newer versions: Thunderbird menu -> Preferences -> Preferences -> Advanced -> General -> Config Editor

Source: here

· One min read
Hreniuc Cristian-Alexandru

This is how you can download an archive using curl:

curl -L -O
  • -L - Follow redirects
  • -O - Write output to a file named as the remote file

· 5 min read
Hreniuc Cristian-Alexandru

The main source of inspiration were this thread and this thread.

The first steps are to install the specific tools on linux to be able to flash a new OS on the phone. On my PC I have Arch Linux, I had to install android-tools : sudo pacman -S android-tools

Check if the phone is rooted

Before trying to root your phone, check if it\'s not already rooted(The Chinese phones come already rooted).

To do this you need to follow this steps:

  • activate USB debugging in your phone(Developer options).
  • Connect the phone via USB(Choose File transfer when the USB popup appears on the phone)
  • Check if the device is visible in adb: adb devices, it should show a device, not an empty list.
  • Run command sudo adb reboot bootloader, this will reboot the phone in bootloader mode. Another method is to press and hold volume up and power buttons. Source: here or with images here.
  • Check if the device is visible when running sudo fastboot devices
  • Now check if the device is rooted: sudo fastboot oem device-info

After you installed android tools, you will have adb and fastboot commands available.

The command from above will generate something like this:

(bootloader)   Device tampered: false
(bootloader) Device unlocked: true
(bootloader) Device critical unlocked: true
(bootloader) Charger screen enabled: false
(bootloader) Serial console enabled: false
(bootloader) Serial hw output enabled: false
(bootloader) Display panel:

If the line Device unlocked is set to true, Ex: Device unlocked: true it means that the device is already rooted. But if you have this line: Device unlocked: falseit means that the device is not rooted.

Root the phone

The next steps should be made only if you had this line Device unlocked: false.

Start quote source: here . The next few paragraphs were copy-pasted, because I haven\'t tested them, my phone was already rooted so I didn\'t had to do these things, but I pasted them here just in case someone needs them. You can also check the original thread.

Downgrade to 01D Rom In some EUI roms you don\'t have to downgrade to 01D rom, but if you don\'t know if your rom can be unlocked or if you wanna feel more confortable and to avoid problems, is better to downgrade -firmware WIXCNFN5802005041S (see Settings > About Phone to confirm whether you\'re on this firmware or a different one... if you\'re on a different firmware on 20s, you don\'t need to downgrade) -stock 26s (if your x722 came with 26s, you need to downgrade to 01D)

you can find the file here: Download Basically: Attetion!!! This update is to be used in the official recovery, TWRP will hard brick, don\'t flash it with TWRP

  • Put file inside your sdcard
  • Reboot to recovery(steps above)
  • Click on install update, and 01D rom will be installed
  • Now you can reboot to fastboot mode and unlock your bootloader
  • In fastboot mode type fastboot oem unlock-go
  • Check if the phone is rooted with the steps from above.

Now, under Stock 20S unlocked folder you\'ll have a stock rom, cleaned, unlocked and friendly to root, you can intall in fastboot by opening flash.bat

End quote

Flash TWRP

  • Download TWRP from here
  • Boot your phone to Recovery Mode(adb reboot bootloader or Buttons Volume Up + Power pressed until something appears on the screen.)
  • Flash the twrp image: sudo fastboot flash recovery ./twrp-3.2.3-0-20181031-codeworkx-zl0.img
  • Boot again to Recovery Mode: sudo fastboot boot ./twrp-3.2.3-0-20181031-codeworkx-zl0.img(Or using the buttons like I said above). You should get the twrp menu.
  • Voila

Flash AICP and Gapps

Here is the original thread:

  • Download the latest version of AICP
  • Download Gapps from here, choose mini or pico(the difference between them is the google apps, you can download the changelogs and compare them to see.)
  • Deactivate USB debugging
  • Copy archives on your phone via USB(you may need to connect the phone to a windows PC and install the Qualcomm USB drivers: here or here)
  • Activate USB debugging
  • Reboot into Recovery Mode(buttons or adb reboot bootloader and sudo fastboot boot ./twrp-3.2.3-0-20181031-codeworkx-zl0.img)
  • Wipe the System, Cache, Data and ART/Dalvik cache.
  • Go to install and search for your AICP archive and swipe to install it.
  • Go back to install and search for Gapps archive and swipe to install it.
  • You can flash the Magisk app here, I covered them below. It\'s better if you do them here. Short: Copy archive and install it.
  • Reboot the system(Optional: Do not install the TWRP app when asked).

Flash and install Magisk

  • Check the main thread from XDA formus and download the latest version, the zip archive.
  • Deactivate USB debugging
  • Copy it on your phone via USB(you may need to connect the phone to a windows PC and install the Qualcomm USB drivers: here or here)
  • Activate USB debugging
  • Reboot into Recovery Mode(buttons or adb reboot bootloader and sudo fastboot boot ./twrp-3.2.3-0-20181031-codeworkx-zl0.img)
  • Go to install and search for your archive, swipe to install it and reboot the system.
  • After reboot, open the Magisk app, it will ask you to install the full version, do it.
  • After everything is done, you will notice that it installed Magisk Manager app, and it removed the Magisk app.
  • Open Magisk Manager and click on install Magisk, choose the zip version, it will download it.
  • Reboot into recovery mode and install again the Magisk zip archive.
  • Reboot the system.
  • Voila.

· 4 min read
Hreniuc Cristian-Alexandru

Resources: - Getting started with tmux - Youtube turorial 1 - Youtube turorial 2 Install tmux on Debian

sudo apt-get install tmux

You can also install tmuxinator, which is easier to use, you can create session easily. Tmux has a lot of keybindings, those keybindings are in this format CTRL + B [command]. The CTRL + B is called the prefix, it like letting tmux know that the next key pressed is a command for it. You press CTRL + B release and then press a letter(command). Each tmux session has a number of windows, and each window has a number of panes. Create a new tmux session:

tmux new -s name

Commands for windows: CTRL + B [command]- c - Creates a new window.

  • ,(comma) - Gives you the possibility to rename the window.
  • p - Go to the previous window.
  • n - Go to the next window.
  • w - List all windows(scrollable list of windows).
  • & - Kill current window.
  • f - Search for a window by name.

Commands for panes: CTRL + B [command]- % - Split vertically the current pane in two panes.

  • **** - Split horizontally the current pane in two panes.
  • o - Go to the next pane.
  • { - Move pane to left with one position.
  • } - Move pane to right with one position.
  • q - Show pane numbers + if you press a number, the pane with that number will become active(will have the cursor)
  • x - Kill current pane.
  • z - Zoom in the current pane.(It will enlarge it to the size of the whole terminal, to go back do the combination of keys again)

Move between panes : CTRL + B left-arrow/right-arrow/up-arrow/down-arrowResize current pane: CTRL + B left-arrow/right-arrow/up-arrow/down-arrow(but do not release CTRL) Set a predefined layout: CTRL + B Spacebar**Sessions:- CTRL + B** D - Detach from the session.

List all sessions:

tmux list-sessions
# or
tmux ls

Attach to a session:

tmux attach -t name_of_session

Running commands that do not have keybindings: CTRL + B :(two dots) [text-command]:- split-window - Splits the window horizontally

  • setw synchronize-panes on/off - Write the same thing on all panes.
  • lock-client - follow the leader All clients connected to tmux session will be on the same page, when one goes to another page, all go there.
  • lock-client off - Disable follow the leader

To scroll through output history: > Ctrl-b then [ then you can use your normal navigation keys to scroll around (eg. Up Arrow or PgDn). Press q to quit scroll mode. Alternatively you can press Ctrl-b PgUp to go directly into copy mode and scroll one page up (which is what it sounds like you will want most of the time)

More keybindings can be found here: To navigate through command history, use the mouse scroll

Change the config of tmux:- Create a config file in the home directory:

touch ~/.tmux.conf
  • Add a keybinding to reload configuration while running tmux:
# reload config file (change file location to your the tmux.conf file)                                                         
bind-key r source-file ~/.tmux.conf\; display-message Config reloaded.
  • Add everything you want there, layout design, keybindings, etc.

Content of .tmux.conf:

# Create tmux work-session or attach to it if it already exist

######################### Script begin ###########################
# new-window command or use alias neww

# send-keys 'cd ~/data/project' C-m \; \
# Sends the command from '' and C-m will execute it.

docker_container_running=$(docker ps | grep container_name_2 | wc -l)
tmux has-session -t $SESSIONNAME &> /dev/null
if [ $? -ne 0 ]
tmux new-session -s $SESSIONNAME\; \
send-keys 'cd ~/data/project' C-m \; \
rename-window "project" \; \
new-window -c ~/data/project1 -n 'project1' \; \
new-window -c ~/data/project2 -n "project2" \; \
new-window -c ~/data/project3 -n 'project3' \; \
new-window -c ~ -n 'home' \; \
new-window -n 'qserver_qtcreator' 'xhost +; if [ $(docker ps | grep container_name | wc -l) -eq 0 ]; then docker start -i container_name; else docker exec -it container_name /bin/bash; fi' \; \
split-window -h -c ~/data/project/source_1 \; \
split-window -v -c ~/data/project/source_1 'xhost +; if [ $(docker ps | grep container_name | wc -l) -eq 0 ]; then docker start container_name; fi; docker exec -it -e QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb container_name qtcreator' \; \
select-window -t "project_qtcreator"
tmux a -t $SESSIONNAME
################################### End Script #################################

# Add alias command work-session in ~/.bashrc
alias work-session='bash ~/data/'

# Reload configuration
source ~/.bashrc

· One min read
Hreniuc Cristian-Alexandru

Use this addon on firefox.

YouTube\'s new design uses Polymer 2.0, and the userscript below no longer works. Since as of right now this question is the top Google hit for queries related to changing this behavior I have created a Chrome extension and a Firefox 57+ add-on which I open sourced in case anyone wants to look at the internals (or create a port for other browsers). Please note that I will no longer be maintaining the userscript version.

Source: stackexchange