Skip to content

Instantly share code, notes, and snippets.

View synackme's full-sized avatar

Landon Mayo synackme

  • Houston, Tx
View GitHub Profile
@synackme
synackme / mac_osx_apache_group.txt
Created February 7, 2014 07:07
In order to retain full ownership of the files and directories but give access to Apache, one wants to use the ACL feature built into Mac OS X. By using sudo chmod -R +a '_www allow read,write,delete,add_file,add_subdirectory,file_inherit,directory_inherit' <dir>, you’ll grant the required permissions to Apache while keeping everything else inta…
sudo chmod -R +a '_www allow read,write,delete,add_file,add_subdirectory,file_inherit,directory_inherit' <dir>
@synackme
synackme / remove_blanks.sh
Created February 6, 2014 01:29
cat a file & pipe to egrep to remove lines
grep -v \# foo.txt | egrep '^$' -v
@synackme
synackme / PKCS2PEM.txt
Created January 16, 2014 23:25
Convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM
openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes
@synackme
synackme / autoSetDisplay.sh
Created January 14, 2014 10:32
This is a quick tip if you use an xserver that is running remotly and you want to set the DISPLAY enviroment variable when you login to the machine using ssh. It is actually very simple to do. When you use ssh it will automatically set the SSH_CLIENT enviroment variable to contain the client connection details eg the ip address port number etc..…
if [ ! $DISPLAY ] ; then
    if [ "$SSH_CLIENT" ] ; then
        export DISPLAY=`echo $SSH_CLIENT|cut -f1 -d\ `:0.0
    fi
fi
@synackme
synackme / autoSetDisplay.sh
Created January 14, 2014 10:32
This is a quick tip if you use an xserver that is running remotly and you want to set the DISPLAY enviroment variable when you login to the machine using ssh. It is actually very simple to do. When you use ssh it will automatically set the SSH_CLIENT enviroment variable to contain the client connection details eg the ip address port number etc..…
if [ ! $DISPLAY ] ; then
    if [ "$SSH_CLIENT" ] ; then
        export DISPLAY=`echo $SSH_CLIENT|cut -f1 -d\ `:0.0
    fi
fi
@synackme
synackme / kdanmobile.com.letter.html
Created January 12, 2014 18:40
The bug report form at http://kdanmobile.com/en/letter.html failed to send Error Message: Sorry send mail failure, please try again or contact with [email protected]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<!--套件會導致 select 不能綁定 onchange 先把js拿掉 script language="javascript" type="text/javascript" src="js/niceforms.js"></script> niceforms 表格套件-->
<link rel="stylesheet" type="text/css" media="all" href="css/niceforms-default.css" /><!--niceforms 表格套件-->
<title>KdanMobile - Mail Us</title>
</head>
<style type="text/css">
#1: Control ls command output
## Colorize the ls output ##
alias ls='ls --color=auto'
## Use a long listing format ##
alias ll='ls -la'
## Show hidden files ##
alias l.='ls -d .* --color=auto'
@synackme
synackme / script_3_1.php
Last active August 31, 2020 11:22
Downloading a file from the Web with fopen() and fgets()
<?php
# Define the file you want to download
$target = "http://www.WebbotsSpidersScreenScrapers.com/hello_world.html";
$file_handle = fopen($target, "r");
# Fetch the file
while (!feof($file_handle))
echo fgets($file_handle, 4096);
fclose($file_handle);
@synackme
synackme / css_resources.md
Created January 9, 2014 07:33 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@synackme
synackme / rails_resources.md
Created January 9, 2014 07:33 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h