Skip to content

Instantly share code, notes, and snippets.

@eliasby
eliasby / magento_lock.php
Created October 24, 2014 20:23
Magento Lock
<?php
class BigThings
{
/**
* Our process ID.
*/
const PROCESS_ID = 'bigthings';
/**
@eliasby
eliasby / patch_diff_usage.sh
Last active August 29, 2015 14:08
Patch and Diff usage
diff -u original.c new.c > original.patch
# To create a patch for an entire source tree, make a copy of the tree:
# cp -R original new
diff -rupN original/ new/ > original.patch
# Apply patch
patch foo.txt < bar.patch
@eliasby
eliasby / freebsd_zsh_prompt.sh
Created October 29, 2014 22:57
FresBSD ZSH prompt
autoload colors; colors
export PS1="%B[%{$fg[red]%}%n%{$reset_color%}%b@%B%{$fg[cyan]%}%m%b%{$reset_color%}:%~%B]%b "
@eliasby
eliasby / xorg_change_keyboard_layout.sh
Created November 3, 2014 19:07
Xorg change key board layout
setxkbmap de &
@eliasby
eliasby / freebsd_vmware_xorg_conf
Created November 3, 2014 19:17
FreeBSD VMware Xorg conf
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/local/lib/xorg/modules"
FontPath "/usr/local/lib/X11/fonts/misc/"
#!/bin/sh
# This script is a workaround to virtualbox
# hostonly network hang on OSX Maverick.
vboxmanage hostonlyif remove vboxnet0
vboxmanage hostonlyif create
@eliasby
eliasby / freebsd_allow_sshd_remote_root_login.sh
Created November 5, 2014 11:14
FreeBSD | Allow remote SSH root login
# /etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
AllowUsers root
@eliasby
eliasby / freebsd_mount_fs_single_user_mode.sh
Created November 17, 2014 00:21
FreeBSD mount rw / on single user mode
mount -u /
mount -a
@eliasby
eliasby / magento_get_common_urls.php
Created November 17, 2014 00:24
Magento get common URLs
// Get Base Url
Mage::getBaseUrl();
// Get Skin Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
// Unsecure Skin Url
$this->getSkinUrl('images/imagename.jpg');
// Secure Skin Url
@eliasby
eliasby / git_checkout_remote_branch.sh
Created November 17, 2014 00:27
Git, checkout remote branch
git fetch origin
git checkout -b serverfix origin/serverfix