Skip to content

Instantly share code, notes, and snippets.

@ersingencturk
ersingencturk / setup python.md
Last active May 26, 2024 15:09
Installing Python 3.11 & Rust on Raspberry Pi

Installing Python 3.11 & Rust on Raspberry Pi

Python 3.11 is not available as apt package on debian raspbian bullseye so installing from source needed

updatepython2v11.sh can be used to compile python 3.11 on raspberry pi

installing packages like bcrypt and cryptography needs rust compiling so rust compiler needed if you don't do that you will get error liek this:

Building wheels for collected packages: bcrypt
@whiskerz007
whiskerz007 / gist:9d146fcb99e6db1cfb9d21bd7287f5ed
Created August 7, 2019 10:12
Create a Windows Scheduled Task to synchronize the clock when the internet is established
C:\WINDOWS\System32\schtasks.exe /CREATE /RU "NT AUTHORITY\LOCAL SERVICE" /SC ONEVENT /EC "Microsoft-Windows-NetworkProfile/Operational" /MO "*[System[Provider[@Name='Microsoft-Windows-NetworkProfile'] and EventID=10000]]" /TN "Update Time When Connected to Internet" /TR "C:\WINDOWS\System32\w32tm.exe /resync /force"
@nijave
nijave / metered.ps1
Created June 23, 2019 14:56
Powershell check if on metered network
[void][Windows.Networking.Connectivity.NetworkInformation, Windows, ContentType = WindowsRuntime]
$cost = [Windows.Networking.Connectivity.NetworkInformation]::GetInternetConnectionProfile().GetConnectionCost()
$cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($cost.NetworkCostType -ne "Unrestricted")
@nax3t
nax3t / paperscript-sublimetext3-syntax.md
Last active December 28, 2020 16:04
Paperscript JS Syntax Highlighting - Sublime Text 3
  • Download and Install Sublime Text 3.1.1 Build 3176
  • Install Package Control (don't forget to restart Sublime after)
  • Install PackageResourceViewer (restart Sublime)
  • Open the Command Palette (Tools > Command Palette from Sublime task menu)
  • Enter open resource and select PackageResourceViewer: Open Resource
  • Enter html and select HTML
  • Enter sub and select HTML.sublime-syntax
  • Click Find > Find... from the Sublime task menu (or use cmd+f or ctrl +f) and search for (?:java|ecma)
  • Replace (?:java|ecma) on line 38 with (?:java|ecma|paper)
  • Save and close the file
@kauffmanes
kauffmanes / install_anaconda.md
Last active July 18, 2024 21:15
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
@seidler2547
seidler2547 / convert_ha_sqlite2mysql.sh
Last active April 16, 2024 02:30
One-liner to convert an existing Home-Assistant SQLite database to MySQL
# prerequisites:
## install software
apt install mariadb-server libmariadbclient-dev sqlite3
## install mysqlclient in virtualenv
su -c 'homeassistant/bin/pip3 install mysqlclient --upgrade' -l homeassistant
## create database
mysql -e 'CREATE SCHEMA IF NOT EXISTS `hass_db` DEFAULT CHARACTER SET utf8'
## create user (use a safe password please)
mysql -e "CREATE USER 'hass_user'@'localhost' IDENTIFIED BY 'hass_pw'"
mysql -e "GRANT ALL PRIVILEGES ON hass_db.* TO 'hass_user'@'localhost'"
@4ley
4ley / apache.conf
Created March 28, 2017 12:10
WordPress / Apache / Reverse Proxy
<VirtualHost ...>
...
# Reverse Proxy
ProxyRequests Off
#ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
ProxyPass /blog http://blog.example.org/blog
ProxyPassReverse /blog http://blog.example.org/blog
...
</VirtualHost>
// ...
let webpack = require("webpack");
mix.webpackConfig({
plugins: [
// Choose the language you want to keep (Ex: "fr")
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /fr/)
]
});
@mlocati
mlocati / win10colors.cmd
Last active July 13, 2024 05:06
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@vilaca
vilaca / synth0.ino
Created March 30, 2015 10:01
Arduino 'Synth' using 8 bit Sigma-Delta DAC v0.0.0
/*
Arduino 'Synth' using 8 bit Sigma-Delta DAC v0.0.0
Can be played over serial. Connect speaker to pin9 and GND.
Piano keys: z s x d c v g b h n j m ; ( + shift = transpose up)
Mute: space
Transpose up: +
Transpose down: -
Change OSC FX: *