This file contains 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
# Fixes home dir and SSH key perms | |
chmod go-wrx ~ | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/authorized_keys |
This file contains 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
find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \; |
This file contains 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
-- Creating a user in Magento when ity magically disappears | |
LOCK TABLES `admin_role` WRITE , `admin_user` WRITE; | |
SET @SALT = "rp"; | |
SET @PASS = CONCAT(MD5(CONCAT( @SALT , "password") ), CONCAT(":", @SALT )); | |
SELECT @EXTRA := MAX(extra) FROM admin_user WHERE extra IS NOT NULL; | |
INSERT INTO `admin_user` (firstname,lastname,email,username,password,created,lognum,reload_acl_flag,is_active,extra,rp_token_created_at) | |
VALUES ('Firstname','Lastname','[email protected]','myuser',@PASS,NOW(),0,0,1,@EXTRA,NOW()); |
This file contains 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 | |
# Need 2 directories: | |
# 1 ./toprocess | |
# 2 ./processed | |
# | |
# PHP dumps PDFs into "toprocess" dir. | |
# This script then converts and dump jpgs into "processed" | |
# Then deletes pdf contents of current directory. | |
# | |
# Run this script via crontab as so: |
This file contains 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 | |
for i in *.jpg; do convert $i -resize 97x57 $i; done |
This file contains 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
/* | |
css3-mediaqueries.js - CSS Helper and CSS3 Media Queries Enabler | |
author: Wouter van der Graaf <wouter at dynora nl> | |
version: 1.0 (20110330) | |
license: MIT | |
website: http://code.google.com/p/css3-mediaqueries-js/ | |
W3C spec: http://www.w3.org/TR/css3-mediaqueries/ |
This file contains 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
var express = require('express') | |
, cookieSessions = require('./cookie-sessions'); | |
var app = express(); | |
app.use(express.cookieParser('manny is cool')); | |
app.use(cookieSessions('sid')); | |
app.get('/', function(req, res){ | |
req.session.count = req.session.count || 0; |
This file contains 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
grep 'user\|dbname\|pass' app/etc/local.xml | tr -d '\n' | sed 's/<username><\!\[CDATA\[\(.*\)\]\]><\/username>.*<password><\!\[CDATA\[\(.*\)\]\]><\/password>.*<dbname><\!\[CDATA\[\(.*\)\]\]><\/dbname>/ mysqldump -u\1 -p\2 \3 > ..\/\3.sql/g' | sh |
This file contains 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 | |
# Count number of headers in all CSV files in the current directory | |
for i in `ls`; do echo $i; head -1 $i | sed 's/,/ /g' | wc -w;done |