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
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
The fix is just adding | |
` | |
respond_to :json | |
` | |
to your custom SessionsController | |
The reason is that the parent session controller does not know how to respond when respond_with is being called. |
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
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; | |
import com.google.api.client.http.HttpRequestInitializer; | |
import com.google.api.client.http.HttpTransport; | |
import com.google.api.client.json.JsonFactory; | |
import com.google.api.client.json.jackson2.JacksonFactory; | |
import com.google.api.services.compute.Compute; | |
import com.google.api.services.compute.ComputeScopes; | |
import com.google.api.services.compute.model.*; | |
import com.google.auth.http.HttpCredentialsAdapter; | |
import com.google.auth.oauth2.GoogleCredentials; |
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 osx | |
2. install win 10 | |
3. You will find that windows boot manager will make clover dissapear from bios | |
4. in Windows terminal, run as admin, Bcdedit /set {bootmgr} path \EFI\BOOT\BOOTX64.efi | |
5. You now able to boot to clover |
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. pip install esptool | |
2. Download all three files from http://www.espruino.com/Download, which includes bootloader.bin, espruino_esp32.bin, partitions_espruino.bin | |
3. | |
esptool.py \ | |
--chip esp32 \ | |
--port /dev/ttyUSB0 \ | |
--baud 115200 \ | |
--after hard_reset write_flash \ | |
-z \ | |
--flash_mode dio \ |
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
Make jupyter notebook to use virtualenv | |
1. virtualenv ENVNAME | |
2. source ./ENVNAME/bin/activate | |
3. pip install ipykernel | |
4. python -m ipykernel install --user --name ENVNAME --display-name "Python (whatever you want to call it)" |
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
Create a file ( Desktop File ) with this content: | |
[Desktop Entry] | |
Version=1.0 | |
Name=Android Studio | |
Type=Application | |
Icon=/PATH/TO/ICON/studio.png | |
Exec=/PATH/TO/studio.sh | |
Change /PATH/TO/ICON/studio.png and /PATH/TO/studio.sh accordingly. | |
save the file as: android-studio.desktop in /usr/share/applications |
NewerOlder