Tuesday, July 16, 2019

Debian Tips and Tricks



https://askubuntu.com/questions/81296/repeat-key-functionality-doesnt-work
Go to system settings >> keyboard and make sure that repeat and speed are set correctly.
when this doesn't work, it sometimes helps to disable repeat keys and enable it again.

https://askubuntu.com/questions/27213/what-is-the-linux-equivalent-to-windows-program-files/551932
/bin and /usr/bin is where the scripts are that start the programs. The direct equivalent of "Program Files" though is probably /usr/share. That directory contains the various support files for most programs.
https://askubuntu.com/questions/4477/how-do-i-find-packages-to-install-via-apt-get
apt-cache search nvidia settings

simply type dpkg -L <package-name> in a terminal, it will display all files installed by that package, then you can recognize the binary program names by looking at their location. Usually programs are installed in /usr/bin directory or /sbin directory.
https://www.howtogeek.com/117709/how-to-change-your-default-applications-on-ubuntu-4-ways/
For example, let’s say you wanted to change the system’s default text editor. Run the following command in a terminal:
sudo update-alternatives --config editor
To go through the choices for every alternative on your system, run the following command:
sudo update-alternatives --all
https://askubuntu.com/questions/777410/how-to-set-atom-editor-to-main-editor
You can set the EDITOR variable as follows in Terminal
export EDITOR="/usr/bin/atom"
If you want that as a permanent setting consider adding it to your ~/.bashrc and reload the updated .bashrc via source ~/.bashrc.


gnome-system-monitor
https://forums.linuxmint.com/viewtopic.php?t=224584
Move panel in Linux Mint 18 Cinnamon?
1) Right click on the panel and select "Modify Panel"
2) Select "Move panel"
3) Click on the top of the screen and it will move to there.
https://www.marksanborn.net/linux/10-linux-shortcuts-you-cant-live-without/
https://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/
  • Ctrl+Z: Suspend the current foreground process running in bash. This sends the SIGTSTP signal to the process. To return the process to the foreground later, use the fg process_name command.
  • Ctrl+D: Close the bash shell. This sends an EOF (End-of-file) marker to bash, and bash exits when it receives this marker. This is similar to running the exit command.

https://www.howtogeek.com/267348/how-to-add-tabs-to-ubuntus-terminal/
On the Preferences dialog box, make sure the General tab is active. Then, select “Tab” from the “Open new terminals in” drop-down list.
Add panel, or custom panel to add widget.
If we accidentally delete window list,  we can add it back

Ctrl+Alt+L to lock screen
3: Alt + Tab


Alt-tab is going to the next application and alt-` (the key just over tab) gets you to the next windows of the same application. It

https://askubuntu.com/questions/83118/create-a-link-to-a-folder-on-the-left-panel-of-nautilus-file-manager
Create a link to a folder on the left panel of Nautilus file manager?
You can add Bookmarks. Just go to the desired directory and via Global Menu → Bookmarks → Add bookmark.
Or you can use simply Ctrl+D when you are in the desired directory.
For Ubuntu 13.04 or more updated versions, you can click the "gear" icon on top right and use "Add Bookmark"

https://forums.linuxmint.com/viewtopic.php?t=271670
Alt-F4 is the standard method for closing windows.


sudo service docker start

sudo docker run hello-world


sudo apt-get install openjdk-11-jdk

Synaptic Package Manager doesn't launch from the Application Menu
https://askubuntu.com/questions/185755/synaptic-package-manager-doesnt-launch-from-the-application-menu
  1. Open terminal (ctrl+alt+T) and execute:
    gksudo gedit /usr/share/applications/synaptic.desktop
    
    If gksudo is not installed, you can just install it. It's provided by the gksu Install gksu package.
    (Or you can run sudo -H gedit instead. But avoid sudo gedit).
  2. Change line Exec=synaptic-pkexec to Exec=gksudo synaptic.
  3. Save file and close text editor.
http://xahlee.info/linux/linux_swap_mouse_buttons.html
xinput --list

# swap the middle and right button for device 13
xinput --set-button-map 13 1 3 2

# swap the middle and right button for device named Logitech USB Trackball
xinput --set-button-map "Logitech USB Trackball" 3 2 1
Normally, the those button numbers in the command line are in order, like this: 1 2 3 ...
  • if you call … --set-button-map 2 1 3, that means you set button 1 to do 2, and button 2 to do 1.
  • if you call … --set-button-map 1 1 1, that means making buttons 1 2 3 all do button 1.
http://xahlee.info/linux/linux_set_mouse_speed.html

# set mouse speed to twice as fast
xset m 2 0
# set mouse speed to 3 x, when moved 4 counts within 10 milisecond
xset m 3 4
# set mouse speed to default
xset m default

  • list the peripherals, note the good number with the device name of the mouse!
    xinput list
    
  • list parameters from peripheral number 9
    xinput list-props 9
    
  • set the acceleration of peripheral 9 to value 3. The higher the value is, the more you divide the acceleration. Acceleration is maximum for a value equal to 1. The "basis" value seems to be 1.7, for me...
    xinput set-prop 9 'Device Accel Constant Deceleration' 3
    
To permanently set the change :
A hidden file in your directory is ".profile" (Ctrl+H to see hidden files) Double click on it and open it. Copy paste the previous command at the end. That's it!
P.S. to apply the same command for all users you can edit the file /etc/profile (not an hidden file).

https://askubuntu.com/questions/285689/increase-mouse-wheel-scroll-speed
Install imwheel with the following command or from the Software Center:
$ sudo apt-get install imwheel
Create (if necessary) and edit the configfile ~/.imwheelrc with an editor of your choice (e.g. gedit). Fill in the following for increasing the scroll speed for every Command. NB: This configuration file will apply these new scroll settings to all programs, (including the terminal, which may not be what you want).
".*"
None,       Up,     Up,     3
None,       Down,   Down,   3
If you want to only apply these settings to Chrome, for instance, use these settings instead:
".*-chrome*"
None,       Up,     Up,     3
None,       Down,   Down,   3
The 3 is a scroll multiplier to increase the effectiveness of the scroll wheel. In the README of the project it is called "REPS". The readme states:
[ REPS ]
Reps (Repetitions) lets you say a number for how many times you want the output keysyms to be pressed. See the chart on the default bindings for the default number of reps for each modifier-combo (The chart is near the end of this document).
In other words, it is a scroll multiplier. If REPS is set to 3, that means that when your mouse wheel commands one scroll command, the software intercepts this command and sends 3 commands to the PC instead of 1, thereby making it scroll 3 times farther, or "faster".

You can start imwheel by typing:
$ imwheel
Be sure that you don't start the imwheel twice! That's a known bug, but you can stop imwheel with the command:
$ killall imwheel
To get imwheel to automatically start every time your computer boots, you must add it to the startup menu AFTER an x-window is loaded. IMPORTANT: since imwheel relies on an x-window to already be running, it will NOT work if you add it to crontab, /etc/init.d, or /etc/rc.local. That means you must do it this way instead:
Ubuntu:
Use the "Startup Applications" GUI editor to Add imwheel as a Startup Program: https://askubuntu.com/a/48327/327339
Xubuntu:
Use the "Session and Startup" GUI editor --> Application Autostart --> Add to add imwheel as a startup program.




Labels

Review (572) System Design (334) System Design - Review (198) Java (189) Coding (75) Interview-System Design (65) Interview (63) Book Notes (59) Coding - Review (59) to-do (45) Linux (43) Knowledge (39) Interview-Java (35) Knowledge - Review (32) Database (31) Design Patterns (31) Big Data (29) Product Architecture (28) MultiThread (27) Soft Skills (27) Concurrency (26) Cracking Code Interview (26) Miscs (25) Distributed (24) OOD Design (24) Google (23) Career (22) Interview - Review (21) Java - Code (21) Operating System (21) Interview Q&A (20) System Design - Practice (20) Tips (19) Algorithm (17) Company - Facebook (17) Security (17) How to Ace Interview (16) Brain Teaser (14) Linux - Shell (14) Redis (14) Testing (14) Tools (14) Code Quality (13) Search (13) Spark (13) Spring (13) Company - LinkedIn (12) How to (12) Interview-Database (12) Interview-Operating System (12) Solr (12) Architecture Principles (11) Resource (10) Amazon (9) Cache (9) Git (9) Interview - MultiThread (9) Scalability (9) Trouble Shooting (9) Web Dev (9) Architecture Model (8) Better Programmer (8) Cassandra (8) Company - Uber (8) Java67 (8) Math (8) OO Design principles (8) SOLID (8) Design (7) Interview Corner (7) JVM (7) Java Basics (7) Kafka (7) Mac (7) Machine Learning (7) NoSQL (7) C++ (6) Chrome (6) File System (6) Highscalability (6) How to Better (6) Network (6) Restful (6) CareerCup (5) Code Review (5) Hash (5) How to Interview (5) JDK Source Code (5) JavaScript (5) Leetcode (5) Must Known (5) Python (5)

Popular Posts