Skip to content

Instantly share code, notes, and snippets.

@jasimmk
jasimmk / init.vim
Last active May 17, 2019 20:20
init.vim/~.vimrc
set nocompatible " required
filetype off " required
" set the runtime path to include vundle and init
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" pass path where vundle should install plugins
" call vundle#begin('~/somepath/here')
#!/bin/env python
##
## Script to remove injected scripts from php files
##
## Refer regex escaping http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
import glob
import re
from optparse import OptionParser
@jasimmk
jasimmk / remove_php_hijacked.py
Last active November 8, 2016 23:14
Removes hijacked and injected code snippets from php files. Make sure you compile the TEXT Pattern using regular expression escaping
#!/bin/env python
##
## Script to remove injected scripts from php files
##
## Refer regex escaping http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
import glob
import re
FILE_PATTERN = '*.php'
@jasimmk
jasimmk / insert_50k_odoo_customer.py
Last active October 23, 2019 13:50
Helps us create 50k customers in odoo; Install fake factory at first. pip install fake-factory
#!/usr/bin/env python
# Install fake factory at first. Helps us create 50k customers in odoo
# pip install fake-factory
# Documentation for odoo is listed here
# https://www.odoo.com/documentation/9.0/api_integration.html#calling-methods
# MIT License
# Copyright (c) 2016 Jasim Muhammed
@jasimmk
jasimmk / odoo_request_log_parser.py
Last active December 11, 2018 09:42
Script to generate slow request table from Odoo logs. Make sure you pass `--log-handler openerp.http.rpc.request:DEBUG` when you run odoo server. This make sure response timing in Odoo logs. Script is expecting log entries like below. 2016-09-16 05:50:33,880 23231 DEBUG odoo_test openerp.http.rpc.request: call_kw: ir.model.data xmlid_to_res_id: …
#!/usr/bin/env python
# MIT License
# Copyright (c) 2016 Jasim Muhammed
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@jasimmk
jasimmk / Vagrantfile
Created September 15, 2016 07:06
Vagrant file for odoo9 ubuntu 16.04
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@jasimmk
jasimmk / install_odoo9_ubuntu1604.sh
Last active September 11, 2016 10:08
Automate installation of Odoo9 and Postgres 9.5 in singlestep
#!/bin/bash -u
# Single command odoo 9 installation. For Ubuntu 16.04
#
# TODO: If source folder exists, we will not be cloning odoo repo
# TODO: Install this only on test enviroments. Script installs odoo and postgres
# Server. Please don't attempt on production systems unless you know how to
# fix the script
#
# MIT License
@jasimmk
jasimmk / country_extension.py
Last active March 12, 2024 13:44
Countries without Postal Code, ISO Code, Python
# https://en.wikipedia.org/wiki/List_of_postal_codes
# http://www.geopostcodes.com/data
class NoPostalCodeCountries(object):
_countries = {
"AO": "Angola",
"AG": "Antigua and Barbuda",
"AW": "Aruba",
"BS": "Bahamas",
"BZ": "Belize",
worker_processes 4;
worker_rlimit_nofile 8192;
events {
worker_connections 3000;
}
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
@jasimmk
jasimmk / gist:290d92ba167854119f16
Created October 27, 2015 07:17
Supervisor daemon for Ubuntu
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36