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
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 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
1. install transmission-daemon and samba | |
2. mkdir /transmission-share | |
3. sudo usermod -a -G debian-transmission $(whoami) | |
4. sudo chgrp debian-transmission /transmission-share | |
5. sudo chmod 770 /transmission-share | |
6. sudo vim /etc/transmission-daemon/settings.json | |
change download_dir to /transmission-share | |
change umask from 18 to 2 | |
append rpc-whitelist with 192.168.*.* | |
reference: https://askubuntu.com/questions/221081/permission-denied-when-downloading-with-transmission-daemon |
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
To temporarily disable power management | |
$ sudo /sbin/iwconfig wlan0 power off | |
To turn off power management permanently | |
$ sudo vim /etc/pm/power.d/wireless | |
""" | |
#!/bin/sh | |
/sbin/iwconfig wlan0 power 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
===To enter pg with user postgres=== | |
sudo su | |
su postgres | |
psql | |
-- to create roles -- | |
CREATE ROLES username PASSWORD 'password' INHERIT LOGIN | |
-- to alter roles -- | |
ALTER ROLES username [SUPERUSER/CREATEDB/CREATEROLE] | |
===To see current connection, user, password (host:port:db:user:password)=== |
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
bitbucket does not send challenge https://developer.atlassian.com/server/bitbucket/how-tos/example-basic-authentication/#supplying-basic-auth-headers | |
$ wget --http-user="samgooi4189" --http-password="MpBrJa9dC3vkWgmTcjLF" --auth-no-challenge "https://api.bitbucket.org/2.0/repositories/samgooi4189/bitbucket-download-test/src/master/README.md" | |
--2020-09-02 22:21:57-- https://api.bitbucket.org/2.0/repositories/samgooi4189/bitbucket-download-test/src/master/README.md | |
Resolving api.bitbucket.org (api.bitbucket.org)... 18.205.93.6, 18.205.93.7, 18.205.93.8, ... | |
Connecting to api.bitbucket.org (api.bitbucket.org)|18.205.93.6|:443... connected. | |
HTTP request sent, awaiting response... 200 OK | |
Length: 2622 (2.6K) [text/plain] | |
Saving to: ‘README.md’ |
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
It is imperitive that you need to change 2 files in order to prevent transmission to overwrite your changes. | |
The default credential is admin:admin | |
1. SSH into your synology | |
2. edit /var/packages/transmission/target/var/settings.json to change the username and password | |
3. edit /var/packages/transmission/var/settings.json to change the username and password | |
To understand how the username and password get inserted into the settings.json, you can read /var/packages/transmission/scripts/service-setup |
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
# clone and cd into your repo | |
create config/master.key | |
38e8eded99cab7f153507c62c5093659 | |
# Add non-root user | |
useradd --create-home --shell /bin/bash deploy | |
sudo usermod -aG sudo deploy | |
sudo echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers | |
su deploy | |
cd |
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 | |
``` |
NewerOlder