Skip to content

Instantly share code, notes, and snippets.

View kanmeiban's full-sized avatar

Sava Lachezarov kanmeiban

View GitHub Profile
@kanmeiban
kanmeiban / sound.md
Last active February 1, 2024 01:42
Fix sound on Asus Zenbook UX370UA-PRO

Linux 6.6.10 on Manjaro

In /etc/modprobe.d/alsa-base.conf:

options snd_hda_intel model=dell-headset-multi

DON'T REBOOT - shutdown and start again!

In /usr/share/alsa-card-profile/mixer/paths/analog-output.conf.common - not sure if this is needed

@kanmeiban
kanmeiban / xfs.md
Last active October 11, 2023 18:27
Fixing corrupt XFS filesystem with dirty log that cannot be mounted

Situation

Linux root partition with XFS that cannot be mounted because of dirty and inconsistent log. Log can be neither repaired nor cleared:

$ sudo xfs_repair /dev/nvme0n1p7
Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
Log inconsistent (didn't find previous header)
@kanmeiban
kanmeiban / linux-tips.md
Last active July 6, 2018 12:03
Linux tips & tricks

Bluetooth

Connect devices that is paired and powered on but for some reason just doesn't want to connect:

$ sudo bluetoothctl
[bluetooth]# paired-devices 
Device 28:FC:F6:08:24:30 EVOLVEO G4
Device CB:08:92:3C:8E:A0 M585/M590
[bluetooth]# connect CB:08:92:3C:8E:A0
Attempting to connect to CB:08:92:3C:8E:A0
[CHG] Device CB:08:92:3C:8E:A0 Connected: yes
@kanmeiban
kanmeiban / .bash_profile
Last active November 2, 2016 16:06
macOS Sierra bash settings - git prompt abomination
PATH=$PATH:~/bin
if [ -f /usr/local/share/chruby/chruby.sh ] && [ -f /usr/local/share/chruby/auto.sh ]; then
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
chruby ruby-1.9.3-p392
fi
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
@kanmeiban
kanmeiban / .tm_properties
Created November 1, 2016 14:09
TextMate 2 vital settings
# Save on loosing focus
saveOnBlur = true
# Do not show spaces when 'Show Invisible Characters' is enabled
invisiblesMap = "~ "
gem: --no-ri
@kanmeiban
kanmeiban / .inputrc
Created October 31, 2016 15:25
Ctrl+➡️and Ctrl+⬅︎in mac OS Terminal
"\e[1;5D": backward-word
"\e[1;5C": forward-word
@kanmeiban
kanmeiban / .profile
Created October 31, 2016 15:19
Mac OS X bash settings
PATH=$PATH:~/bin
if [ -f /usr/local/share/chruby/chruby.sh ] && [ -f /usr/local/share/chruby/auto.sh ]; then
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
chruby ruby-1.9.3-p392
fi
if [ -f ~/.git-prompt.sh ]; then
source ~/.git-prompt.sh
#!/bin/sh
# |skip entire .git | | skip binary files | remove trailing whitespace
find . -not \( -name .git -prune \) -type f -print0 | xargs -0 file -In | grep -v binary | cut -d ":" -f1 | xargs ruby -pi -e 'gsub(/ +$/, "")'
@kanmeiban
kanmeiban / gist:2b0179509efa6c4ebd5b
Last active August 29, 2015 14:18
SSH into guest CentOS installed in VirtualBox on Mac OS X host
  1. Stop virtual machine if it's running.
  2. Under Settings -> Network -> Adapter 2 select Attached to: Host-only Adapter
  3. Start the virtual machine
  4. In the virtual machine, edit /etc/sysconfig/network-scripts/ifcfg-eth1:

DEVICE=eth1 HWADDR=08:00:27:21:b3:8b # Copy address from Adapter 2 settings. # Beware, Mac address is shown without colons there. TYPE=Ethernet ONBOOT=yes