strace -e trace=file -fp PID (file) or strace -e trace=desc -fp PID (file descriptors)
Common calls:
accessclose– close file handlefchmod– change file permissionsfchown– change file ownership
| #!/usr/bin/env python | |
| #coding=utf-8 | |
| # | |
| # Generate a list of dnsmasq rules with ipset for gfwlist | |
| # | |
| # Copyright (C) 2014 http://www.shuyz.com | |
| # Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules | |
| import urllib2 | |
| import re |
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
| <?php | |
| function hash_djb2($str){ | |
| $hash = 5381; | |
| $length = strlen($str); | |
| for($i = 0; $i < $length; $i++) { | |
| $hash = ( ($hash << 5) + $hash ) + $str[$i]; | |
| } | |
| return ($hash & 0xFFFFFFFF); | |
| } |
| # INSERT | |
| # -- before: Check uniqueness | |
| # -- after: | |
| # UPDATE | |
| # -- before: Log old data | |
| # -- after: Email admin queue | |
| # DELETE | |
| # -- before: check for dues | |
| # -- after: System cleanup |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>Single-Column Responsive Email Template</title> | |
| <style> | |
| @media only screen and (min-device-width: 541px) { | |
| .content { |
| <?php | |
| /* These are two points in New York City */ | |
| $point1 = array('lat' => 40.770623, 'long' => -73.964367); | |
| $point2 = array('lat' => 40.758224, 'long' => -73.917404); | |
| $distance = getDistanceBetweenPoints($point1['lat'], $point1['long'], $point2['lat'], $point2['long']); | |
| foreach ($distance as $unit => $value) { | |
| echo $unit.': '.number_format($value,4).'<br />'; | |
| } |
| from Crypto.Cipher import AES | |
| from Crypto import Random | |
| BS = 16 | |
| pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
| unpad = lambda s : s[0:-ord(s[-1])] | |
| class AESCipher: | |
| def __init__( self, key ): | |
| """ |