一系列常用模型的Keras实现
Multilayer Perceptron (MLP) for multi-class softmax classification
from keras.models import Sequential| from gensim.models import KeyedVectors | |
| # Load gensim word2vec | |
| w2v_path = '<Gensim File Path>' | |
| w2v = KeyedVectors.load_word2vec_format(w2v_path) | |
| import io | |
| # Vector file, `\t` seperated the vectors and `\n` seperate the words | |
| """ |
Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.
inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)| <# | |
| .Synopsis | |
| Get a Quote for any topc | |
| .DESCRIPTION | |
| Get-Quote cmdlet data harvests a/multiple quote(s) from Web outputs into your powershell console | |
| .EXAMPLE | |
| PS > Quote -Topic "success" | |
| For me success was always going to be a Lamborghini. But now I've got it, it just sits on my drive. | |
| Curtis Jackson [50 Cent], American Rapper. From his interview with Louis Gannon for Live magazine, The Mail on Sunday (UK) newspaper, (25 October 2009). | |
| .EXAMPLE |
sudo resize2fs /dev/mmcblk0p2ssh empty file to the /boot partition to enable headless boot and SSH server
wpa_supplicant.conf file to the /boot partition to enable WiFi
| automation: | |
| - alias: Turn on garden lights when sun sets | |
| trigger: | |
| platform: sun | |
| event: sunset | |
| action: | |
| service: switch.turn_on | |
| entity_id: switch.garden_lights | |
| - alias: Turn off garden lights when sun rises |
| ... | |
| from OpenSSL import SSL | |
| ... | |
| context = SSL.Context(SSL.TLSv1_2_METHOD) | |
| context.use_privatekey_file('/etc/letsencrypt/live/DOMAIN.COM/privkey.pem') | |
| context.use_certificate_chain_file('/etc/letsencrypt/live/DOMAIN.COM/fullchain.pem') | |
| context.use_certificate_file('/etc/letsencrypt/live/DOMAIN.COM/cert.pem') |
sudo nmcli dev wifi hotspot ifname wlan0 con-name "my-hotspot" ssid "my-hotspot" password "My HotsPoT Strong Password"
More info here
| #!/bin/sh | |
| runMinecraftCommand="java -Xms256M -Xmx768M -jar minecraft_server.jar nogui" | |
| startScript="start.sh" | |
| echo "Great let's get minecraft setup!" | |
| # Sanity check, do we have java installed? | |
| if ! hash java 2>/dev/null; then | |
| echo "You don't have java installed. You're gonna have a tough time." | |
| echo "Are you sure you selected the default Amazon Linux HVM ami?" |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm