Skip to content

Instantly share code, notes, and snippets.

View filipsPL's full-sized avatar
💭
🚀 travelling to Mars and back

filips filipsPL

💭
🚀 travelling to Mars and back
View GitHub Profile
@myano
myano / cs.py
Created June 30, 2011 01:25
Quick example of ncurses in Python!
#!/usr/bin/env python
import curses
import curses.textpad
import time
stdscr = curses.initscr()
#curses.noecho()
#curses.echo()
@StuartGordonReid
StuartGordonReid / DistanceMetrics.py
Created June 15, 2015 14:36
Implementation of various distance metrics in Python
import math
import random
import csv
import cProfile
import numpy as np
import hashlib
memoization = {}
@AdamGagorik
AdamGagorik / remote-jupyter-notebook.md
Last active June 5, 2023 06:48
Remote Jupyter Notebook

Description

Use these commands to run a jupyter server on a remote server and access it locally in a browser. You must have SSH access to the browser. Use any port you want.

Do not forget to change username@server to the correct value!

TLDR

where using command
@leelasd
leelasd / convert_molecules.py
Created March 2, 2017 01:55
Convert Smiles code to 3D and save to SDF
import pandas as pd
from rdkit import Chem
from rdkit.Chem import AllChem
df = pd.read_csv('SMILES.csv')
mols = [Chem.MolFromSmiles(smi) for smi in df.SMILES]
hmols = [Chem.AddHs(m) for m in mols]
for mol in hmols:
AllChem.EmbedMolecule(mol,AllChem.ETKDG())
print(AllChem.UFFOptimizeMolecule(mol,1000))
smiles = list(df.SMILES)
@maxwelleite
maxwelleite / ttf-ms-tahoma-installer.sh
Last active May 16, 2024 06:43
Script to install the original Microsoft Tahoma font on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install the original Microsoft Tahoma Regular and MS Tahoma Bold (both version 2.60) on Ubuntu distros.
# Dependencies: wget and cabextract
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
output_dir="/usr/share/fonts/truetype/msttcorefonts/"
tmp_dir="/tmp/ttf-ms-tahoma-installer"
@Hermanio
Hermanio / thermal-conf.xml
Last active April 23, 2023 14:59
A working thermald configuration file for Thinkpad T430 with a trip point of 90C.
<?xml version="1.0"?>
<ThermalConfiguration>
<Platform>
<Name>T430</Name>
<ProductName>*</ProductName>
<Preference>QUIET</Preference>
<ThermalSensors>
<ThermalSensor>
<Type>pkg-temp-0</Type>
<Path>/sys/class/thermal/thermal_zone0/temp</Path>
@fawkesley
fawkesley / randomize-mac-addresses.sh
Last active July 25, 2022 06:24
In Ubuntu 16.04, randomize WiFi MAC addresses with a daily rotation - /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
#!/bin/sh
# /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# INSTALL
#
# > curl -L 'https://gist.github.com/paulfurley/46e0547ce5c5ea7eabeaef50dbacef3f/raw/56ee5dd5f40dec93b8f7438cbdeda5475ea3b5d2/randomize-mac-addresses.sh' |sudo tee /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# > sudo chmod +x /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# Configure every saved WiFi connection in NetworkManager with a spoofed MAC
@pyksid
pyksid / watchdog.sh
Last active January 5, 2022 12:31
openwrt watchdog: interface auto reconnect
#!/bin/sh
ip1=8.8.8.8
ip2=208.67.222.222
tries=3
if [[ -z $1 ]]; then
logger -t watchdog "Missing interface name"
exit 1
fi
@shrayasr
shrayasr / fu-garmin-bulk-delete.js
Created March 28, 2018 06:03
Bulk delete activities in Garmin Connect
function foo() {
console.log("foo - start")
$("button.search-button").click()
setTimeout(function() {
var li = $(".list-item")[0]
var delButton = $(li).find("button.js-activity-delete")
var confirmDelButton = $(li).find("button.delete-yes")
console.log(delButton, confirmDelButton)
@mwaskom
mwaskom / palettes.png
Last active July 9, 2024 20:35
Show all seaborn palettes and simulate what they look like with various color vision deficiencies. (The 10-element seaborn palettes will be part of the forthcoming 0.9 release).
palettes.png