Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@denilsonsa
denilsonsa / README.md
Last active May 1, 2024 11:54
Help setting up ETS2 for 2 asymmetrical displays with nvidia GTX 550
@denilsonsa
denilsonsa / README.md
Last active August 15, 2023 05:01 — forked from noromanba/README.md
add permanently HEAD links on Gist for UserScript
@denilsonsa
denilsonsa / telegram-tg-links-to-web-tg.user.js
Last active May 23, 2023 20:18
Telegram tg:// to web+tg:// — user-script, AKA greasemonkey script.
@denilsonsa
denilsonsa / README.md
Last active May 1, 2024 11:55
ets2-mobile-route-advisor - Map demo using Leaflet

ets2-mobile-route-advisor - Map demo using Leaflet

This Gist is outdated. Look at denilsonsa/ets2-stuff for the most recent code.

@denilsonsa
denilsonsa / 51-these-are-not-joysticks.rules
Last active August 6, 2022 15:51
Fix for keyboard/mouse/tablet being detected as joystick in Linux — Moved to https://github.com/denilsonsa/udev-joystick-blacklist
#
# ███╗ ███╗ ██████╗ ██╗ ██╗███████╗██████╗ ████████╗ ██████╗
# ████╗ ████║██╔═══██╗██║ ██║██╔════╝██╔══██╗ ╚══██╔══╝██╔═══██╗
# ██╔████╔██║██║ ██║██║ ██║█████╗ ██║ ██║ ██║ ██║ ██║
# ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║ ██║ ██║
# ██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗██████╔╝ ██║ ╚██████╔╝
# ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝╚═════╝ ╚═╝ ╚═════╝
#
# ╔═════════════════════════════════════════════════════════════════╗
# ║ https://github.com/denilsonsa/udev-joystick-blacklist ║
@denilsonsa
denilsonsa / README.md
Last active December 3, 2023 04:56 — forked from a9cQ0Q/README.md

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow 3G -l 600ms -p 10%   # slow network on eth0 and setup latency to 600ms packetloss to 10%
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency

slow dsl -b 1mbps # Simulate DSL with a slower speed than the default

@denilsonsa
denilsonsa / Python Virtual Environments on Debian and Ubuntu.md
Last active December 1, 2016 06:25
Python Virtual Environments on Debian and Ubuntu

pyvenv-3.3 (Ubuntu 13.10, also Debian)

Symptoms

pyvenv-3.3 venvdir
venvdir/bin/python -c 'import sys; print(sys.path)'
# This should print the venvdir in sys.path.

But in buggy Ubuntu/Debian, it doesn't.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Live demo of Nosy Facetype by Rory Harnden</title>
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,400italic' rel='stylesheet' type='text/css'>
<style type="text/css">
@font-face {
font-family: "Nosy";
src: url(NOSY_Facetype_by_Rory_Harnden.otf) format("opentype");
@denilsonsa
denilsonsa / timezone_and_django.py
Last active August 29, 2015 14:03 — forked from anonymous/dpaste.de_snippet.py
datetime object, when rendered to Django template, was always 6 minutes off.
class LocalDateTimeField(with_metaclass(models.SubfieldBase, models.DateTimeField)):
'''A hack/workaround version of DateTimeField that considers the datetime
from the database as local time.
'''
def to_python(self, value):
from django.utils.dateformat import format
value = models.DateTimeField.to_python(self, value)
if isinstance(value, datetime):
print('-' + repr(value))
print(strftime('%Y-%m-%d %H:%M:%S.%f', value.timetuple()))