Skip to content

Instantly share code, notes, and snippets.

<?php
$mageFilename = __DIR__.'/app/Mage.php';
require_once($mageFilename);
Mage::init();
$templates = array(
array(
"name" => "New Invoice",
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html
@xxorax
xxorax / log-session.sh
Last active September 3, 2019 10:38
Log SSH input and output
#!/bin/sh
#
# log-session
# John Simpson <[email protected]> 2008-08-06
# https://www.jms1.net/ssh-record.shtml
#
# Put this script as forced SSH command in authorized_keys file :
# command="/usr/local/sbin/log-session" ssh-dss AAAAB3Nza...
#
###############################################################################
@xxorax
xxorax / ssh-hostname-unhash.sh
Last active November 11, 2024 01:25
Unhash the hostnames hashed in your known_hosts file by passing their names.
#!/bin/bash
# based on http://unix.stackexchange.com/questions/175071/how-to-decrypt-hostnames-of-a-crypted-ssh-known-hosts-with-a-list-of-the-hostna/175199#175199
function replace {
host="$1"
found=$(ssh-keygen -F "$host" 2>/dev/null | grep -v '^#' | sed "s/^[^ ]*/$host/")
if [ -n "$found" ]; then
ssh-keygen -R "$host" &>/dev/null
echo "$found" >>~/.ssh/known_hosts
echo "Found and replaced: $host"
<!doctype html>
<html ng-app="myApp">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
<script type="text/javascript">
var myApp = angular.module('myApp', [], function ($interpolateProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
});
void function() {//closure
var global = this
, _initKeyboardEvent_type = (function( e ) {
try {
e.initKeyboardEvent(
"keyup" // in DOMString typeArg
, false // in boolean canBubbleArg
, false // in boolean cancelableArg
, global // in views::AbstractView viewArg
@xxorax
xxorax / multip.py
Created February 1, 2013 23:26
Run multi processes over Python Thread. example : python myltip.py -c 'sleep 4 && echo ok' -c 'sleep 4 && echo ok'
import Queue
import threading
import time
import sys
import os
import multiprocessing
from optparse import OptionParser
import subprocess
import json