This file contains 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 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 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 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 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 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 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 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
Problem: | |
(byebug) devise_parameter_sanitizer.sanitize(:sign_up) | |
{} | |
Investigation: | |
1. We post the data to the backend in this format | |
``` | |
$ curl -X POST -H "Content-Type: application/json" --data "{\"user\": {\"email\":\"abc@abc.com\", \"password\": \"1234567890\", \"password_confirmation\": \"1234567890\"}}" localhost:3000/api/v1/users | |
``` |
This file contains 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
class GooiBot < RTanque::Bot::Brain | |
NAME = 'gooi_bot' | |
include RTanque::Bot::BrainHelper | |
MAX_RAND_DIVISION = 10.0 | |
def tick! | |
## main logic goes here | |
@current_heading ||= sensors.heading |