This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ft='find / -type f -exec grep -i $1 {} +' | |
alias jj='java -jar' | |
alias k8000="fuser -k -n tcp 8000" | |
alias k3000="fuser -k -n tcp 3000" | |
alias n8='echo "nameserver 8.8.8.8" > /etc/resolv.conf' | |
alias ng='sudo service nginx stop; sudo service httpd start' | |
alias no='su - $(whoami)' | |
alias ns='nmap -sP 192.168.0.1/24' | |
alias p8='ping 8.8.8.8' | |
alias pacin='sudo pacman -S' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#SSH into the new server, and run this from the home directory. Granted ~/public_html is the Apache DocumentRoot for | |
#the user | |
import getpass | |
import os | |
print '\nThis script will automate the process of moving a website from one server to another.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#vi /etc/X11/xorg.conf.d/10-synaptics.conf | |
#Supports Horizontal and Vertical Edge Scrolling, Two Finger Right click (tested on Dell XPS) | |
Section "InputClass" | |
Identifier "touchpad" | |
Driver "synaptics" | |
MatchIsTouchpad "on" | |
Option "TapButton1" "1" | |
Option "TapButton2" "3" | |
Option "VertEdgeScroll" "on" | |
Option "HorizEdgeScroll" "on" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install rpm-build cabextract ttmkfdir | |
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec | |
rpmbuild -bb msttcorefonts-2.5-1.spec | |
rpm -ivh $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm | |
fc-cache -f -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slugify=function(str){ | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#http://wireless.kernel.org/en/users/Drivers/b43 | |
su - | |
yum install b43-fwcutter wget # apt-get or whatever your package manager is | |
export FIRMWARE_INSTALL_DIR="/lib/firmware" | |
wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2 | |
tar xjf broadcom-wl-5.100.138.tar.bz2 | |
sudo b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" broadcom-wl-5.100.138/linux/wl_apsta.o | |
echo 'modprobe b43' > /etc/sysconfig/modules/b43.modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Backup: | |
adb remount | |
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db mmssms.db | |
#Restore: | |
adb remount | |
adb push mmssms.db /data/data/com.android.providers.telephony/databases/mmssms.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ ! -f sublime_text_3.tar.bz2 ]; then | |
curl -L "http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3083_x32.tar.bz2" -o "sublime_text_3.tar.bz2" | |
fi | |
tar -xvjf sublime_text_3.tar.bz2 | |
sudo cp -fr "sublime_text_3/sublime_text.desktop" "/usr/share/applications/sublime_text.desktop" | |
sudo sed -i 's/Icon=sublime-text/Icon=\/opt\/sublime_text\/Icon\/128x128\/sublime-text.png/g' /usr/share/applications/sublime_text.desktop | |
rm -rf /opt/sublime_text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://stackoverflow.com/questions/13210663/how-to-order-knockout-bindings | |
ko.bindingHandlers.chosen = { | |
init: function(element, valueAccessor, allBindingsAccessor, viewModel) { | |
var allBindings = allBindingsAccessor(); | |
var options = {default: 'Select one...'}; | |
$.extend(options, allBindings.chosen) | |
$(element).attr('data-placeholder', options.default); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from django.template import resolve_variable, NodeList | |
from django.contrib.auth.models import Group | |
register = template.Library() | |
@register.tag() | |
def ifusergroup(parser, token): | |
""" Check to see if the currently logged in user belongs to one or more groups |
OlderNewer