Skip to content

Instantly share code, notes, and snippets.

View TurBoss's full-sized avatar

TurBoss TurBoss

  • Spain
View GitHub Profile
@TurBoss
TurBoss / client.py
Created January 26, 2015 14:32 — forked from abma/client.py
#!/usr/bin/env python
from xmlrpclib import ServerProxy
proxy = ServerProxy('http://api.springfiles.com/xmlrpc.php')
searchstring = {
"category" : "engine_linux64",
"limit": 1
}
import itertools
from panda3d.core import NodePath
from panda3d.core import TransformState
from panda3d.core import Vec3
from panda3d.bullet import BulletBoxShape
from panda3d.bullet import BulletConeShape
from panda3d.bullet import BulletConvexHullShape
from panda3d.bullet import BulletCylinderShape
@TurBoss
TurBoss / ajax_setup.js
Last active August 29, 2015 14:26 — forked from rca/ajax_setup.js
Setup Django CSRF token in JQuery AJAX requests
/**
* setup JQuery's AJAX methods to setup CSRF token in the request before sending it off.
* http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request
*/
function getCookie(name)
{
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
The following are command line commands for backing up /dev/sda1 in the same manner
that "redo backup and restore" uses. Note that the MD5 of the partition files will
not be the same because gzip stores info about the current time
(http://superuser.com/questions/617934/):
#mount network drive
mount.cifs '//host.example.com/fab/temp' /mnt/backup -o username=myuser,password=mypass
#save backup list (sda1 in our case)
echo sda1 > /mnt/backup/20141009.backup
@TurBoss
TurBoss / Cloudbox
Created July 23, 2016 15:26 — forked from sleimanzublidi/Cloudbox
Cloudbox SSH
t's quite easy, no disassembling required.
1. Enable SFTP in the web interface
2. Open a SFTP connection to the box using your admin account
3. Change directory to the Admin: cd Admin
4. Create a link for default.runlevel file: symlink /etc/initng/runlevel/default.runlevel default.runlevel
5. Create a link for shadow file: symlink /etc/shadow shadow
6. Create a link for unicorn.sharing.ssh.conf file: symlink /etc/unicorn/unicorn_conf/unicorn.sharing.ssh.conf unicorn.sharing.ssh.conf
7. You can close SFTP connection now
8. Open the web file manager in your browser and navigate to the Admin folder
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 / 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-$$"
@TurBoss
TurBoss / self-signed-root-ca-and-certificates.sh
Created September 9, 2017 20:12 — forked from jaymecd/self-signed-root-ca-and-certificates.sh
Create Root CA and self-signed Certificate for local TLS testing.
#!/usr/bin/env bash
set -e
# Full Qualified Domain Name
FQDN="${1:-localhost.dev}"
FQDN="$(echo "${FQDN}" | tr 'A-Z' 'a-z')"
# Optional settings
COUNTRY="DE"
@TurBoss
TurBoss / GStreamer-1.0 some strings.sh
Created September 11, 2017 19:09 — forked from strezh/GStreamer-1.0 some strings.sh
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \