Skip to content

Instantly share code, notes, and snippets.

View komuw's full-sized avatar

Komu Wairagu komuw

View GitHub Profile
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
@komuw
komuw / how to properly install virtualbox on chromebook
Last active February 16, 2022 09:13
how to properly install virtualbox on chromebook.
Taken from:https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)
https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)
only pasted here so I can be sure I will always have it.
NB: do this ALTERNATIVE INSTEAD(it solves multi reboots on vagrant up)
1. build kernel headers as per this diff method: https://github.com/divx118/crouton-packages/blob/master/README.md
ie: from a shell in ua chroot(ubuntu)
$ cd ~
$ wget https://raw.githubusercontent.com/divx118/crouton-packages/master/setup-headers.sh
@komuw
komuw / enable vt-x in chromebook
Last active April 11, 2024 23:33
How To enable VT-x support in chromebook
Generously taken from this discussion; https://github.com/dnschneid/crouton/issues/675
They've created a wiki: https://github.com/dnschneid/crouton/wiki/Repack-kernel-to-Enable-VT_x-for-Virtualbox
You should check it out to see if anything has changed.
A. first of all install virtualbox correctly: https://gist.github.com/komuW/10991598. then;
1.Open a shell on your Chrome OS
ie while in in chromeOS; open browser, then ctrl+alt+T, then type shell, then press enter
2.Disable verified boot :
@komuw
komuw / create_sale_order.py
Last active August 6, 2020 22:48
Creating and updating a sale.order in openERP
##############################
#Creating a sale order including the products.#
import oerplib
oerp = oerplib.OERP('localhost', protocol='xmlrpc', port=8069)
user = oerp.login('user', 'passwd', 'db_name')
#create a dictionary with fields and their values. the dict ought to have at a minimum all the fields that are marked required=True for that model
sale_order_dict = {
'picking_policy': 'direct',
'currency_id': 98,
#python script for fibonacci between 1 and 100
#example: 1,2,3,5,8,13
hold=[]
temp1 = 1
temp2 = 2
hold.append(temp1); hold.append(temp2)
for i in range(3, 101):
temp3 = temp1 + temp2
@komuw
komuw / terminal_VPN_client
Last active November 26, 2022 21:53
commandline VPN client
If for any reason you don't have a GUI VPN client(you like running headless ubuntu
or have ubuntu installed on a chromebook). You can use vpnc as a command line VPN client
#this is a comment
#install vpnc
$ sudo apt-get install network-manager-vpnc
#look to see if you have vpnc installed
$ sudo vpnc --help #use sudo to run vpnc command
#if not installed, install it:
$ sudo apt-get install vpnc
@komuw
komuw / install NVM and nodeJS.yml
Created November 20, 2014 17:40
Ansible task to install nvm and nodeJS
#first seen here: http://www.snip2code.com/Snippet/63701/Ansible-task-to-install-nvm-and-node
# Here is how to install nvm and node in an Ansible task.
# I tried a bunch of different things, and as usual it's simple, but you have to get it right.
# The important part is that you have to shell with /bin/bash -c and source nvm.sh
---
- name: Install nvm
shell: >
curl https://raw.githubusercontent.com/creationix/nvm/v0.7.0/install.sh | sh
creates=/home/{{ ansible_user_id }}/.nvm/nvm.sh
@komuw
komuw / install ubuntu crouton
Last active August 29, 2015 14:11
install ubuntu via crouton in a chromebook
1. open a browser and go to https://goo.gl/fd3zc, that will download crouton
2. hit Ctrl+alt+T and then type shell and press enter
$ shell
3. install ubuntu via
$ sudo sh ~/Downloads/crouton -r trusty -t xfce
#that will install ubuntu 14.04 with xfce desktop environment
4. to list available versions:
@komuw
komuw / gist:caeb33a164d0d6d6310a
Created January 5, 2015 09:04
output log for vagrant up
INFO global: Vagrant version: 1.7.1
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.1/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Linux"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_LOG="debug"
@komuw
komuw / gist:b98d1b0bdeb6940cc41a
Created January 16, 2015 11:23
monit-odoo/openerp conf file
set daemon 600 #in seconds
set logfile /home/webapp/log/monit.log
check process rabbit with pidfile /var/run/odoo.pid
start program = "/etc/init.d/odoo start"
stop program = "/etc/init.d/odoo stop"