Skip to content

Instantly share code, notes, and snippets.

View csdy's full-sized avatar
💵
Working on the next big thing

David Cassidy csdy

💵
Working on the next big thing
View GitHub Profile
@csdy
csdy / find.sh
Created August 4, 2014 07:44
Scan cPanel /home directory for all symlinks. Useful for checking for common cPanel exploit.
# Scan /home for symlinks (exploit)
cd /home && find -type l
@csdy
csdy / diskusage.sh
Created September 2, 2014 09:54
cPanel - Disk Usage by Account
du -h --max-depth=1 /home
@csdy
csdy / delete.sh
Created September 3, 2014 09:00
Delete files by owner
find /home/ -user username -exec rm -fr {} \;
@csdy
csdy / permissions-octal.sh
Last active March 15, 2019 03:00
Show file permissions in octal notation
find . |xargs stat -c "%G %U %a %n"
@csdy
csdy / gist:304760fd7eb64f8703e0
Created February 28, 2015 07:33
Fix crashed table in MySQL
myisamchk -r -f /usr/lib/{database}/{table_name}.MYI
@csdy
csdy / chunk.sh
Created March 10, 2015 10:24
Chunk File
# Split by size
split -b=1M -d file.txt file
# Split by line
a=(`wc -l yourfile`) ; lines=`echo $a/12 | bc -l` ; split -l=$lines -d file.txt file
@csdy
csdy / events.txt
Created March 17, 2015 05:41
Useful Windows Event Viewer IDs
6005 - The Event log service was started
6006 - The Event log service was stopped (clean shutdown)
6008 - The previous system shutdown at time on date was unexpected
6009 - System booted
@csdy
csdy / public_web.config
Created July 15, 2015 07:55
PhalconPHP URLRewrite (IIS 8.5)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect non-existent files and folders to index.php" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
@csdy
csdy / .csscomb.js
Created August 16, 2015 23:02
CSSComb Defaults
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
@csdy
csdy / truncate.sh
Created August 26, 2015 07:22
Truncate Error Logs Recursively
for item in $(find . -type f -name 'error_log' ) ;do cat /dev/null > $item ;done