Skip to content

Instantly share code, notes, and snippets.

View TurBoss's full-sized avatar

turboss TurBoss

  • Spain
  • 09:16 (UTC +02:00)
View GitHub Profile
@TurBoss
TurBoss / turbowilly.py
Created December 23, 2016 01:37
Serial relay board
#!/usr/bin/python2
import hal
import serial
import sys
import signal
import copy
import io
port = "/dev/ttyS3"
How to create a 4MB FreeDOS boot disk for eg, doing a motherboard bios upgrade.
Originally from http://www.linuxinsight.com/how-to-flash-motherboard-bios-from-linux-no-dos-windows-no-floppy-drive.html
The following is a brief outline of how I created a 4MB CD boot image to update the bios on a motherboard I have been considering buying.
I do not have this motherboard, but I have tested the bootable CD up to the point of actually flashing the bios.
FWIW, my computer runs PATA / IDE HDs and optical drives. Not SATA.
Adjust accordingly to your distro, hardware, etc.
I'm human, and make typos on occasion. So double check your input.
@TurBoss
TurBoss / Odoo reset admin pw
Created January 3, 2017 13:46 — forked from yurytello/Odoo reset admin pw
Hack to reset the admin password of Odoo
Reset admin Password
1) Obtener el login del administrador
=> select login from res_users where id=1;
2) Verificar que tenga habilitado el parámetro auth_signup_reset_password
=> update base_config_settings set auth_signup_reset_password=true;
# Si NO nay registros entonces insertar un nuevo registro
=> insert into base_config_settings(auth_signup_reset_password) values(true);
3) Crear un token de reset_password para el administrador
=> update res_partner
@TurBoss
TurBoss / FF7Config.bat
Created January 4, 2017 20:08
FF7Config.exe killer muahahaha
@ECHO off
SETLOCAL EnableDelayedExpansion
SET N=0
SET CMD="devcon.exe hwids MMDEVAPI* | grep.exe SWD\\MMDEVAPI"
FOR /F "tokens=*" %%i IN (' %CMD% ') DO (
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hal
import sys
import signal
import linuxcnc
import copy
import time
#define ENCODER_OPTIMIZE_INTERRUPTS
#include <Encoder.h>
#include <LedControl.h>
Encoder knob(0, 1);
LedControl lc = LedControl(12, 11, 10, 3);
int steps = 0;
@TurBoss
TurBoss / modem switch
Created April 15, 2017 13:11
Activates the Alcatel X602D
#/usr/local/bin/alcatel_x602d
#!/bin/bash
#
#
for i in /sys/bus/usb/devices/*; do
if [[ `grep -s 1bbb ${i}/idVendor` ]] && [[ `grep -s 022c ${i}/idProduct` ]]; then
DEVICE=$i
break
fi
@TurBoss
TurBoss / CNUM.md
Created April 17, 2017 13:23
How to use AT+CNUM to query own number from

According to the ATC, the own number can be displayed with the command AT+CNUM,

but only in case ithe number s stored on the SIM card by operator.

It is possible also to save your own number on the SIM card, however such functionality sometimes is blocked by MNO.

For most cases the query is not working, for most MNO prefer not to store phone number on the SIM;

@TurBoss
TurBoss / install-pygtk.sh
Created April 17, 2017 17:28 — forked from mehcode/install-pygtk.sh
Install pygtk inside of a virtualenv
# Ensure we're in a virtualenv.
if [ "$VIRTUAL_ENV" == "" ]
then
echo "ERROR: not in a virtual environment."
exit -1
fi
# Setup variables.
CACHE="/tmp/install-pygtk-$$"
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# [SNIPPET_NAME: GtkSourceView Example]
# [SNIPPET_CATEGORIES: PyGTK, PyGTKSourceView]
# [SNIPPET_DESCRIPTION: Demonstrates using Actions with a gtk.Action and gtk.AccelGroup]
#
# This script shows the use of pygtksourceview module, the python wrapper
# of gtksourceview C library.
# It has been directly translated from test-widget.c