mirror of
https://github.com/sahinakkaya/til.git
synced 2025-07-17 14:01:49 +03:00
fix: Add syntax highlighting to code blocks
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
YOU CAN TOGGLE CAPS LOCK FROM COMMAND LINE BY DOING:
|
||||
```
|
||||
```bash
|
||||
xdotool key Caps_Lock
|
||||
```
|
||||
|
||||
|
@ -5,13 +5,13 @@ Read [this](https://wiki.archlinux.org/title/backlight) and you are done :D
|
||||
Here is the tl;dr part.
|
||||
|
||||
Run `ls /sys/class/backlight/` to see which graphics card is managing your backlight. I'm assuming you get an ouput like `intel_backlight`. Then run this:
|
||||
```
|
||||
```bash
|
||||
ls /sys/class/backlight/intel_backlight
|
||||
actual_brightness bl_power brightness device/
|
||||
max_brightness power/ scale subsystem/ type uevent
|
||||
```
|
||||
Read the `max_brightness` value and then set your brightness to something smaller than that value:
|
||||
```
|
||||
```bash
|
||||
cat /sys/class/backlight/intel_backlight/max_brightness
|
||||
echo 100 > /sys/class/backlight/intel_backlight/brightness
|
||||
```
|
||||
@ -23,7 +23,7 @@ RUN+="/bin/chgrp video /sys/class/backlight/intel_backlight/brightness"
|
||||
RUN+="/bin/chmod g+w /sys/class/backlight/intel_backlight/brightness"
|
||||
```
|
||||
and add yourself to the `video` group.
|
||||
```
|
||||
```bash
|
||||
sudo usermod -aG video $USER
|
||||
```
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
If you want to connect to a device via bluetooth:
|
||||
```
|
||||
```bash
|
||||
sudo systemctl enable bluetooth.service
|
||||
bluetoothctl power on
|
||||
bluetoothctl devices # to find the mac address of your device
|
||||
|
@ -7,7 +7,7 @@ N: See apt-secure(8) manpage for repository creation and user configuration deta
|
||||
|
||||
You will need to find corresponding file in `sources.list.d` and delete it.
|
||||
|
||||
```
|
||||
```bash
|
||||
cd /etc/apt/sources.list.d
|
||||
sudo rm bad-repo.list
|
||||
```
|
||||
|
@ -18,11 +18,11 @@ While this is effective it certainly isn’t copy-paste drop dead simple and is
|
||||
|
||||
## Doing it the X11 config way
|
||||
X11 provides configurations in a directory “X11/xorg.conf.d/” this directory could live in various places on your system depending on your distribution. However, X11 will always attempt to also load configurations from /etc/X11/xorg.conf.d/ when present. To ensure the directory exists, run:
|
||||
```
|
||||
```bash
|
||||
sudo mkdir -p /etc/X11/xorg.conf.d
|
||||
```
|
||||
Next we’ll create a new file “90-touchpad.conf”. The configuration file names end with .conf and are read in ASCII order—by convention file names begin with two digits followed by a dash.
|
||||
```
|
||||
```bash
|
||||
sudo touch /etc/X11/xorg.conf.d/90-touchpad.conf
|
||||
```
|
||||
Now open up the file your editor of choice (with suitable write permission of course) and paste the following:
|
||||
|
@ -4,7 +4,7 @@ Here is how it should be done:
|
||||
|
||||
If you want to remap it for X server, add the following line to your `~/.xsession` or `~/.xinitrc`. Make sure to add it before `exec whatever_window_manager` you are using:
|
||||
|
||||
```
|
||||
```bash
|
||||
setxkbmap -option 'caps:ctrl_modifier'
|
||||
```
|
||||
[source](https://superuser.com/questions/566871/how-to-map-the-caps-lock-key-to-escape-key-in-arch-linux)
|
||||
|
@ -1,6 +1,6 @@
|
||||
Recently, I switched to dvorak layout and I am using it everywhere to get used to it. This was the command that worked everywhere (including the login screen):
|
||||
|
||||
```
|
||||
```bash
|
||||
localectl --no-convert set-x11-keymap us pc105 dvp caps:ctrl_modifier
|
||||
```
|
||||
|
||||
|
@ -3,7 +3,7 @@ When my Ctrl key broken, I remapped Capslock to Ctrl as it was the most useless
|
||||
I am a vim user and I don't use Capslock other than typing some constant variable names or SQL syntax etc. They are all happening in vim, specifically, in insert mode. Whenever I switch to normal mode, I want my Capslock to be off. I sometimes forget and instead of moving down with `j`, I find myself `J`oining lines. This happened more than 3 times so it is time to do something.
|
||||
|
||||
I could solve this problem in keyboard level because I have a programmable keyboard. I didn't want to this because sometimes I use my laptop's keyboard and I don't want them to behave differently. So I solved it on OS level. Here are the commands that I run in order to achieve this effect:
|
||||
```
|
||||
```bash
|
||||
mkdir -p ~/.xkb/keymap/
|
||||
mkdir -p ~/.xkb/symbols/
|
||||
vim ~/.xkb/symbols/mysymbols
|
||||
|
@ -1,5 +1,5 @@
|
||||
Make sure that you are not inside the mounted path.
|
||||
|
||||
``````
|
||||
```bash
|
||||
sudo umount /path/to/dev
|
||||
``````
|
||||
```
|
||||
|
@ -1,5 +1,5 @@
|
||||
Today I wanted to ssh into my desktop from my laptop. They were both connected to my phone. Laptop was connected via Wi-Fi and the desktop was connected via USB tethering. Since they are not connected in the same way, they were on different networks and it was not possible to ssh into the other computer. I searched about the problem and found [this article](https://www.systutorials.com/port-forwarding-using-iptables/). Since my phone was rooted, I could run any command I want. The final set of commands which allowed me to ssh between each computers were:
|
||||
```
|
||||
```bash
|
||||
# from laptop to desktop
|
||||
iptables -t nat -A POSTROUTING ! -d 192.168.43.0/24 -o rndis0 -j MASQUERADE
|
||||
iptables -A PREROUTING -t nat -i swlan0 -p tcp --dport 22 -j DNAT --to 192.168.42.17:22
|
||||
|
Reference in New Issue
Block a user