Skip to content

Instantly share code, notes, and snippets.

curl -D cookie1.txt blog.xrmplatform.org/wp-login.php
# step 1
# get default cookie of blog and write cookie to cookie1.txt
# step 2
# simulate browser Firefox( of course , you can use any browser agent<!--more--> what you want!) "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
# input your username and also password
# write new cookie to cookie2.txt
curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" -D cookie2.txt -b cookie1.txt -F log=username -F pwd=password -F testcookie=1 -F wp-submit="Log In" -F redirect_to=blog.xrmplatform.org/wp-admin -F submit=login -F rememberme=forever blog.xrmplatform.org/wp-login.php
# currently cookie2.txt stored all cookie info
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Valid and working as of 11/4/2014
# Xcode 6.1, XCode Server 4
#
API_TOKEN="<Your TestFlight API Token>"
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
<?php
function get_param($key, $filter=FILTER_SANITIZE_STRING) {
if (!isset($_GET[$key])) {
return null;
}
return filter_var($_GET[$key], $filter);
}
function post_param($key, $filter=FILTER_SANITIZE_STRING) {
class Sanitise
{
public function get($name, $filter, $options=null)
{
return $this->sanitise(INPUT_GET, $name, $filter, $options);
}
public function post($name, $filter, $options=null)
{
return $this->sanitise(INPUT_POST, $name, $filter, $options);
@nappa32
nappa32 / nginx.conf
Last active August 29, 2015 14:19 — forked from Stanback/nginx.conf
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;
error_page 404 /404.html
index index.html;
@nappa32
nappa32 / rake multitask
Created November 12, 2015 02:02
rake multitask example
task :task1 => [:big_db_task] do
sleep 1
puts "Task 1"
end
task :big_db_task do
puts "Big db task"
end
task :task3 => [:big_db_task] do
puts "Task 3"
end
@nappa32
nappa32 / .bashrc-extensionfile-1
Created May 30, 2017 01:39
change remote for github to ssh from http
function githubssh ()
{
newremote=$(git remote -v|head -1 |sed 's/https:\/\/github.com\//[email protected]:/g'|awk '{print $2}');
git remote set-url origin $newremote
}
### Keybase proof
I hereby claim:
* I am nappa32 on github.
* I am nappa32 (https://keybase.io/nappa32) on keybase.
* I have a public key ASD_a7VnIEfJtlpqUsngCaquY6dzak3_dxnLwEVhkRD83Qo
To claim this, I am signing this object:
@nappa32
nappa32 / Terraform_functions.md
Created February 21, 2019 01:10 — forked from davewongillies/Terraform_functions.md
Terraform Functions

Supported built-in functions

  • abs(float) - Returns the absolute value of a given float. Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. See also the signum function.

  • basename(path) - Returns the last element of a path.

  • base64decode(string) - Given a base64-encoded string, decodes it and returns the original string.