Skip to content

Instantly share code, notes, and snippets.

View cjjavellana's full-sized avatar

Christian Javellana cjjavellana

View GitHub Profile

Remounting a partition

sudo mount -o remount,exec /tmp

QWebTemplateNotFound: External ID not found in the system: web.login

  1. First of all clear the browser history.

  2. run the command "createdb odoo" or you can use your old database also.

  3. run the openerp-server using this command

@cjjavellana
cjjavellana / gist:1c109ffa015169fde8a1
Last active August 29, 2015 14:14
Tar, Compress and Split Files
#!/bin/sh
if [ "$1" != "" ]
then
log_dir="temp_$1"
echo "Archiving *.war to dailylog_$1.tar"
tar cvf dailylog_$1.tar *.war
echo "Compressing dailylog_$1.tar"
@cjjavellana
cjjavellana / gist:85e8324afc392c8fa90f
Last active August 29, 2015 14:15
Shell Shortcuts
# Finding a file in a zip file
for file in `ls -ltr *.zip | awk '{print $9}'`; do echo "Unzipping $file"; unzip -l $file | grep rm_batch; done;
# Sample output
Unzipping rm_logs_20150221020001.zip
41526 02-21-15 00:55 standalone/rm/logs/rm_batch_20150220.log
Unzipping rm_logs_20150221000000.zip
7353 02-20-15 21:04 standalone/rm/logs/rm_batch_SPMM_20150220.log
37686 02-20-15 22:48 standalone/rm/logs/rm_batch_20150220.log
@cjjavellana
cjjavellana / gist:bd43e5ece005a5aa8ea0
Created March 19, 2015 12:53
Creating Project Specific Gemset
  1. Navigate to your project directory
  2. Execute
rvm use ruby-2.2.1@project-name --create --ruby-version
@cjjavellana
cjjavellana / gist:7518879fcbdb915343b1
Created March 19, 2015 15:33
OSX Terminal Color Scheme
Edit ~/.bash_profile & Paste
export CLICOLOR=1
export LSCOLORS=gxfxcxdxbxegedabagacad
export TERM=xterm-color
export PS1="\[\e[36;1m\]\u@\[\e[32;1m\]\w> \[\e[0m\]"

There is a subtle difference between the expect that is used to validate an output against the expect that is used to validate that a block of code does raise an error

When asserting that an output is correct use:

expect(cart).to be_empty

When expecting a block of code to raise an error:

expect{cart.add_item("fake-sku")}.to raise_error
@cjjavellana
cjjavellana / gist:c2ab52963595c7c8316e
Created May 4, 2015 16:19
Installing redis on centos 6.5
Credit https://aurobindapothal.wordpress.com/2013/06/22/redis-install-in-centos-6-5/
Redis install in centos 6.5
BY AUROBINDAPOTHAL ON JUNE 22, 2013
How to install Redis in Centos/RHEL/Fedora System
Step:1 Install necessary packages
yum install make gcc wget
Step:2 Download the Redis Packages
wget http://redis.googlecode.com/files/redis-2.2.12.tar.gz
tar -xf redis-2.2.12.tar.gz
<script type="text/javascript">
function initialize() {
//var mapOptions = {
// zoom: 4,
// center: new google.maps.LatLng(-34.397, 150.644)
//};
//var map = new google.maps.Map(document.getElementById('geolocation'),
// mapOptions);
var handler = Gmaps.build('Google');
@cjjavellana
cjjavellana / gist:5d39ecf24a39c83e503e
Created July 1, 2015 15:11
Top 3 items of each group
select cat.name, sub.name, x.name, x.price, x.qty from product_categories cat
left join product_categories sub on cat.id = sub.product_category_id
left OUTER JOIN (
SELECT a.*
FROM products a
LEFT JOIN products b ON a.product_category_id = b.product_category_id AND a.id <= b.id
GROUP BY a.name
HAVING count(*) <= 3
ORDER BY a.product_category_id
) x on x.product_category_id = sub.id;
5 took 0.0 secs time to complete
6 took 0.0 secs time to complete
7 took 0.0 secs time to complete
8 took 0.0 secs time to complete
9 took 0.0 secs time to complete
10 took 0.0 secs time to complete
11 took 0.0 secs time to complete
12 took 0.0 secs time to complete
13 took 0.0 secs time to complete
14 took 0.0 secs time to complete