Skip to content

Instantly share code, notes, and snippets.

View drvenabili's full-sized avatar

Simon Hengchen drvenabili

View GitHub Profile
cloud-user@dhh17:/scratch/work/simon/finnish_newspapers/models$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gensim
>>> model = gensim.models.Word2Vec.load("model_fi_1880.bin")
>>> model.wv.most_similar("kirjasto")
[('lukusali', 0.8510360717773438), ('lirjasto', 0.8264331817626953), ('tirjasto', 0.7902065515518188), ('lainakirjasto', 0.7628928422927856), ('luknsali', 0.7343387603759766), ('lulusali', 0.7339579463005066), ('lutusali', 0.7185679078102112), ('kansankirjasto', 0.7182174324989319), ('lukutupa', 0.6950151920318604), ('kirjast', 0.6868242621421814)]
>>> exit()
cloud-user@dhh17:/scratch/work/simon/finnish_newspapers/models$ R
#!/usr/bin/env bash
## This will download and unzip the full bib from the ACL Anthology
## Place this in a publicly accessible folder so you can link the file in Overleaf etc.
## Cronjob to update the file every day at 2 AM:
## 0 2 * * * cd /home/sigmund/aclbib/ && sh dl-bib-extract.sh
wget https://www.aclweb.org/anthology/anthology.bib.gz
gunzip -f anthology.bib.gz
rm -f anthology.bib.gz
# à mettre dans /usr/local/bin
watch -n .5 'cat /proc/cpuinfo | grep "MHz" && echo && sensors | grep "Package" && echo && cat /proc/acpi/ibm/fan | head -n 3 | tail -n 2 && echo "" && cat /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_0_power_limit_uw && echo && cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor && echo && nvidia-smi'
# à mettre dans /usr/local/bin
#!/usr/bin/env bash
if [ ! -d "env" ]; then
echo "Creating venv..."
python3 -m venv env
echo "Activating venv..."
source env/bin/activate
if test -f "requirements.txt"; then
echo "Installing reqs..."
@drvenabili
drvenabili / networkmanager-wifi-powersave.md
Created November 6, 2023 08:47 — forked from jcberthon/networkmanager-wifi-powersave.md
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
blueprint:
# based on luka6000's https://gist.github.com/luka6000/f5b80b9829bbc7c613eac6e909caea83
name: Danfoss Ally TRV 1.18 set external temperature ALSO SET radiatorcovered = true
description: Set external measured temperature to Danfoss Ally TRV firmware 1.18 with Radiator Covered = true
domain: automation
input:
danfoss_trv:
name: Danfoss TRV
description: This is Danfoss Ally climate TRV entity with firmware 1.18 and Radiator Covered = true
selector:
blueprint:
name: Climate schedule
description: Set the target temperature.
domain: automation
input:
climate_id:
name: Thermostat
description: The thermostat to control.
selector:
entity: