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
/* | |
This is utilizing iTextSharp for the PdfReader, PdfStamper and AcroFields classes. | |
*/ | |
DataTable dt = new DataTable();/* fill the DT however you please */ | |
String pdfTemplate = "PATH_TO_PDF_FORM"; | |
System.IO.MemoryStream m = new System.IO.MemoryStream(); | |
PdfReader pdfReader = new PdfReader(pdfTemplate); | |
PdfStamper pdfStamper = new PdfStamper(pdfReader, m); |
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
SELECT model | |
FROM | |
(SELECT model, price FROM PC) | |
UNION | |
(SELECT model, price FROM Laptop) | |
UNION | |
(SELECT model, price FROM PC) model_price | |
WHERE | |
price >= ALL (SELECT price FROM model_price); |
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
require 'ldap' | |
LDAP_S ={ | |
:use_ssl => true, | |
:ldap_host => "domain.com", | |
:domain => "domain.com", | |
:start_tls => false, | |
:ldap_version => 3 | |
} |
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
function parseExcel{ | |
param( | |
[string] $strFileName = $(throw "Please specify an excel file to parse."), | |
[string] $strSheetName = 'Sheet1$', | |
[string] $callListId = $(throw "Please specify a callListId.") | |
) | |
$strProvider = "Provider=Microsoft.Jet.OLEDB.4.0" | |
$strDataSource = "Data Source = $strFileName" | |
$strExtend = "Extended Properties=Excel 8.0" | |
$strQuery = "Select * from [$strSheetName]" |
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
require 'rails/commands/server' | |
require 'socket' | |
module Rails | |
class Server | |
alias :default_options_alias :default_options | |
def default_options | |
ip_addr_list = Socket.ip_address_list | |
#puts ip_addr_list.inspect | |
if ip_addr_list.count >= 2 |
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
cp $1 $1.oldKey | |
AUTH_KEY=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'AUTH_KEY'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
SECURE_AUTH_KEY=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'SECURE_AUTH_KEY'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
LOGGED_IN_KEY=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'LOGGED_IN_KEY'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
NONCE_KEY=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'NONCE_KEY'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
AUTH_SALT=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'AUTH_SALT'" | sed 's/[^-A-Za-z0-9_]/\\&/g') | |
SECURE_AUTH_SALT=$(curl -s https://api.wordpress.org/secret-key/1.1/salt/ | grep "'SECURE_AUTH_SALT'" | sed 's/[^-A-Za-z0-9_]/\\&/g') |
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 -lr --include \*.php --exclude \*id3v2.php "%x[0-9]" . | tee infected-files.txt | |
while read -r filename ; do | |
cp -v "$filename" "$filename.dirty" | |
sed -i "s/<?php \$\w\+ = '.*%x[0-9].*?>//g" "$filename" | |
done < infected-files.txt |
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
$query_select = "select lead.id "; | |
$query_from = ""; | |
$query_where = " where lead.form_id = $form_id"; | |
$query_order = ""; | |
if(!empty($orderby_field)) | |
$query_order = " ORDER BY " . preg_replace("([^0-9A-Za-z_])","",$orderby_field[0]["label"]) . ".value desc "; | |
$query_from .= " from wp_rg_lead lead | |
INNER JOIN wp_rg_lead_detail approval on lead.form_id = approval.form_id and lead.id = approval.lead_id |
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
//As pulled from: http://support.microsoft.com/kb/306158 | |
static private bool impersonateValidUser(String userName, String domain, String password) | |
{ | |
WindowsIdentity tempWindowsIdentity; | |
IntPtr token = IntPtr.Zero; | |
IntPtr tokenDuplicate = IntPtr.Zero; | |
if (RevertToSelf()) | |
{ | |
if (LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE, |
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
Application Error: | |
Application: Plex.exe | |
Framework Version: v4.0.30319 | |
Description: The application requested process termination through System.Environment.FailFast(string message). | |
Message: The system cannot find the file specified. (Exception from HRESULT: 0x80070002) | |
Stack: | |
at System.Environment.FailFast(System.String, System.Exception) | |
at Plex.App+<FlushBugSenseAndFailFastAsync>d__47.MoveNext() | |
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) |
OlderNewer