Skip to content

Instantly share code, notes, and snippets.

View ViktorNova's full-sized avatar

Viktor Nova ViktorNova

View GitHub Profile
@ViktorNova
ViktorNova / gist:9ad2b52daa6b6ec020cb
Created November 7, 2015 00:05
MySQL - Remove hyphens from phone numbers (Asteridex, find & replace)
In this example, user1 is the table name, out is the field name.
I'm removing hyphens from phone numbers.
Note the mysql names have `backticks` around them while the text fields have 'single quotes' around them.
MySQL:
````
update `user1`
set `out` = replace(`out`, '-', '');
````

##Change Container Hostname vzctl set XXX --hostname newname --save

##Duplicate Container - Back up container ('Stop' & 'Good') - Ssh into the server and cd to the dump folder, then move the backup .tgz file to ../template/cache/ - Make a new container, using the backup as a template

  • Edit the container config file before starting the container
@ViktorNova
ViktorNova / opacity_zenity.py
Last active August 29, 2015 14:25 — forked from stelonix/opacity_zenity.py
Simple Zenity slider to change current window transparency. Needs a better way to find the Window who called the script. Made for pekwm. Requires: transset-df, zenity and xprop. Rev 3: Now honors Zenity's return value
#!/usr/bin/python2
import sys, subprocess, os
from subprocess import PIPE, Popen
from threading import Thread
from Queue import Queue, Empty
def enqueue_output(out, queue):
for line in iter(out.readline, b''):
queue.put(line)
@ViktorNova
ViktorNova / MakingStagecraft-Ubuntu14.04.sh
Last active August 29, 2015 14:17
MakingStagecraft-Ubuntu14.04.sh
#!/bin/bash
# PHASE 1
# Stagecraft Core (non-graphical)
apt-get install jackd2 jack-tools jack-midi-clock alsa-base alsa-utils alsa-firmware-loaders libasound2 libasound2-data linux-firmware linux-firmware-nonfree alsamixer aj-snapshot liblo7 python3-liblo openssh-server jack-midi-clock liblash-compat-1debian0 libarchive13 aj-snapshot
#not sure if these are needed in final version
apt-get install suckless-tools # this is dmenu
apt-get install software-properties-common && apt-get update # support for Ubuntu PPAs, not needed for TinyCore version
# Decompression tools
@ViktorNova
ViktorNova / MakingBuildbox-Stagecraft-14.04.sh
Last active August 29, 2015 14:17
Making Buildbox - Stagecraft
BUILD_USER=""
BUILD_DIR="~/Dev"
adduser $BUILD_USER
apt-get install software-properties-common wget
echo "Installing KXstudio repos"
rm -f /var/kxstudio/*
apt-get purge kxstudio-repos
@ViktorNova
ViktorNova / gist:2252b66328654ff20438
Last active August 29, 2015 14:17
Install stripped down Ubuntu server in Proxmox with MATE for remote desktop only
#!/bin/bash
#~ NINETEEN.SH
#~ This script allows you to easily install/update Enlightenment 19 stable on
#~ Ubuntu 14.04 LTS, or remove E19 from your system.
#~ Tip:
#~ Get the Faenza and Faience icon sets for your enlightened desktop before
#~ running the script.
#~ See http://www.noobslab.com/2014/06/faience-and-faenza-icons-for.html
@ViktorNova
ViktorNova / openerp-notes
Created March 28, 2014 21:07
OpenERP Notes
To make make base partner fields mandatory:
Edit the python file directly. I finally found it, the path (on debian) is
/usr/lib/pymodules/python2.7/openerp/addons/base/res/res_partner.py
Find the field, and add "required=True," to that specific field's attributes
@ViktorNova
ViktorNova / OwnCloud Setup - Debian 7 + Postgres
Last active August 29, 2015 13:57
Set up OwnCloud 6 in Debian 7, with Apache and PostgresSQL
0. Install Debian
0. Set up sudo (good practice)
````
apt-get install sudo
adduser it
adduser it sudo
````
Then log out, and log back in as user 'it' (or whatever your new username is)