Skip to content

Instantly share code, notes, and snippets.

@ceme
ceme / Test_Bash_Code_Injection_Vulnerability
Created September 25, 2014 17:23
Test for Bash Code Injection Vulnerability via Specially Crafted Environment Variables (CVE-2014-6271, CVE-2014-7169)
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
@ceme
ceme / ViewZipContents
Created August 14, 2014 17:23
View Zip file contents w/o extraction from command line
unzip -l archive.zip
or:
zipinfo archive.zip
@ceme
ceme / css-target-webkit
Created June 24, 2014 19:09
Webkit specific styles with media query
@media screen and (-webkit-min-device-pixel-ratio:0) {
div{top:0;}
}
@ceme
ceme / heartbleed_fix
Created April 28, 2014 17:36
Heartbleed Bug: OpenSSL Vulnerability (the FIX)
if (1 + 2 + 16 > s->s3->rrec.length) return 0;
hbtype = *p++;
n2s(p, payload);
if (1 + 2 + payload + 16 > s->s3->rrec.length) return 0;
pl = p;
@ceme
ceme / IE9-modernizr-css
Created September 20, 2013 18:31
Modernizr way to target IE css lower than 10
.no-cssanimations .selector {color:red;}
@ceme
ceme / IE10-only-css-targeting
Last active January 2, 2019 09:39
IE 10 specific styles with media query
/**** IE 10 specific styles ***/
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#stupidIE10Fix {color: red;}
}
@ceme
ceme / fibonacci.html
Created May 6, 2013 23:02
fibonacci in js and html5 and jQuery
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>fibonacci</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<div id="content"></div>
<script>
@ceme
ceme / make_files.sh
Created May 6, 2013 22:44
Shell script to make files from a list of file names
#!/bin/sh
trim() { echo $1; }
echo enter file name
read fname
exec < $fname
@ceme
ceme / email_command_line
Created May 6, 2013 22:34
How to send mail from command line unix
echo "Hello : I suppose this is the body" | mail -s "Test from command line" [email protected]
@ceme
ceme / bash_curl_loop
Last active January 9, 2025 09:46
bash curl loop
while true; do sleep 1; curl http://www.google.com; echo -e '\n\n\n\n'$(date);done