Skip to content

Instantly share code, notes, and snippets.

@magussiro
magussiro / curl.md
Created September 27, 2021 10:19 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@magussiro
magussiro / phpdangerousfuncs.md
Created July 30, 2020 02:09 — forked from mccabe615/phpdangerousfuncs.md
Dangerous PHP Functions

Command Execution

exec           - Returns last line of commands output
passthru       - Passes commands output directly to the browser
system         - Passes commands output directly to the browser and returns last line
shell_exec     - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen          - Opens read or write pipe to process of a command
proc_open      - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
@magussiro
magussiro / shell_array.sh
Created July 17, 2020 15:17 — forked from jaceju/shell_array.sh
Shell Script 的陣列範例
#!/bin/bash
versions=("5.6.24" "7.0.9")
function say()
{
value=$1
echo -e "php-$value\n"
}
@magussiro
magussiro / example.php
Created July 17, 2020 15:16 — forked from jaceju/example.php
物件導向基礎與物件導向設計入門
<?php
abstract class Database
{
public function __construct()
{
$this->connect();
}
abstract public function connect();
@magussiro
magussiro / create_zf_project.sh
Created July 17, 2020 15:11 — forked from jaceju/create_zf_project.sh
利用專案樣版在 Subversion 中建立一個 Zend Framework 專案
#!/bin/bash
# Program:
# 利用專案樣版在 Subversion 中建立一個 Zend Framework 專案
# History:
# 2011/11/03 Jace Ju First release
# Usage:
# Create template of project at first time:
# > cd /path/to/project_template
# > mkdir branches
# > mkdir tags
<?php
trait Singleton
{
protected static $_instance = null;
public static function getInstance()
{
if (static::$_instance === null
|| !(static::$_instance instanceof static)) {
@magussiro
magussiro / xss_notes.md
Created July 17, 2020 15:08 — forked from jaceju/xss_notes.md
XSS 上課筆記

XSS 上課筆記

OWASP

  1. Injection
  2. Broken Authentication and Session Management
  3. XSS

Devcore

@magussiro
magussiro / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Created June 29, 2020 01:52 — forked from IamAdiSri/Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H python ./get-pip.py
Installing pip also installs Python3
To run Python3
$ python3
Install pip3 by just executing the same file as in the step above, but this time using Python3
$ sudo -H python3 ./get-pip.py
@magussiro
magussiro / httpserver.sh
Created March 21, 2020 14:41 — forked from upperstream/httpserver.sh
Simple HTTP Server (shell script)
#!/bin/sh
#
# Copyright (C) 2017 Upper Stream.
#
# See the bottom of this file for licensing conditions.
#
#set -x
set -e
@magussiro
magussiro / Readme.txt
Created August 21, 2018 14:24 — forked from tony1223/Readme.txt
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/emailAddress=me@example.com, CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format: