This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sympthoms: | |
$ rails c | |
Running via Spring preloader in process 19704 | |
Loading development environment (Rails 5.1.0) | |
2.4.0 :001 > User.connection | |
Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) | |
from (irb):1 | |
Fix: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reset to HEAD | |
git reset HEAD --hard | |
# will remove unstaged files without removing gitignore file | |
git clean -fd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### | |
# This is a simple script to play video across ssh with VLC | |
### | |
if [[ -z $3 ]]; then | |
echo "Usage: play_remote_video.sh [username] [remote_address] [video_full_path]" | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo modprobe -rv forcedeth | |
sudo modprobe -v forcedeth msi=0 msix=0 | |
sudo ethtool -s eth0 speed 100 duplex full autoneg off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Under lspci -vv, I saw my wifi card bcm43228 is using wl module, but it is working weirdly, so I go inspect dmesg and found: | |
[ 17.135645] wl: module license 'MIXED/Proprietary' taints kernel. | |
[ 17.135648] Disabling lock debugging due to kernel taint | |
[ 17.137273] wl: module verification failed: signature and/or required key missing - tainting kernel | |
[ 17.227089] wlan0: Broadcom BCM4359 802.11 Hybrid Wireless Controller 6.30.223.248 (r487574) | |
[ 17.315644] wl 0000:03:00.0 wlp3s0: renamed from wlan0 | |
linux is loading the wrong device for my wifi card. | |
so I search online and found https://ubuntuforums.org/archive/index.php/t-2209676.html | |
In short, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am having issue with Network Manager in linux when I enable and disable my wifi through hardware switch. | |
All the accees points are not showing up in Network Manager, but I still connected to internet. | |
So here is what I do to get all access point listing issue fixed: | |
1. open /etc/NetworkManager/NetworkManager.conf and edit this: | |
managed=true | |
2. open /etc/network/interfaces and add this: | |
# This is a list of hotpluggable network interfaces. | |
# They will be activated automatically by the hotplug subsystem. | |
auto wlp3s0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# ./createBootableUSB.sh /path/to/distro.iso /dev/sdX | |
sudo apt-get update | |
sudo apt-get install syslinux syslinux-utils --y | |
sudo umount $2 | |
isohybrid $1 --entry 4 --type 0x1c | |
sudo dd bs=8M if=$1 of=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Follow the WORKAROUND: | |
1. Add a comand to /etc/rc.local, add the following line above "exit 0": | |
setpci -s 00:1c.2 0x50.B=0x41 | |
2. Add the same comand to /etc/apm/resume.d/21aspm (which does not exist yet): | |
setpci -s 00:1c.2 0x50.B=0x41 | |
3. Add the following to /etc/modprobe.d/sdhci.conf: | |
options sdhci debug_quirks2=4 | |
4. Re-generate initrd: | |
sudo update-initramfs -u -k all | |
5. Reboot or reload sdhci module: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set regional to BO (Bolivia) since they allow use of 1000 mW tx-power | |
set-bo: | |
sudo ifconfig wlan0 down | |
sudo iw reg set BO | |
sudo ifconfig wlan0 up | |
iwconfig wlan0 | |
# Side effects: | |
# overheating of the power amplifier chip and the card which will cause lower efficiency and more data errors; | |
# overdriving the amplifier which will cause more data errors; |