How to track Process Launches in Linux

Suppose you want to know what processes get launched at a given time on your Linux box like Ubuntu, you can use Auditd. Run the following commands.

apt-get install auditd
auditctl -a task,always
ausearch -i -sc execve

Sources

logging – How can I log all process launches in Linux – Super User. http://superuser.com/questions/222912/how-can-i-log-all-process-launches-in-linux

How to find Crash Log of iOS Simulator

Suppose you do not have Xcode running, but want to view crash logs of your simulator, you can do that easily by visiting

~/Library/Logs/DiagnosticReports/

Here all crash log files can be found with .crash extension.

Note: you need to launch your app without Xcode in order to have the log updated.

Sources

Crash logs generated by iPhone Simulator? – Stack Overflow. http://stackoverflow.com/questions/1864479/crash-logs-generated-by-iphone-simulator

How to parse JSON Array in Swift using AFNetworking

Here I will describe how to parse a JSON array in Swift using AFNetworking for the request. Suppose your network request returns a JSON like

[
{'prop':'Property1'},
{'prop':'Property2'},
...
]

Here’s the code you want to use

// items
let manager = AFHTTPRequestOperationManager()
        
manager.GET("", parameters: nil,
     success: {
         (operation: AFHTTPRequestOperation!,
         responseObject: AnyObject!) in
         if let jsonArray = responseObject as? NSArray {
                    
              for propInfo in jsonArray {
                 let propObject = propInfo as! NSDictionary
                 let prop:String = propObject["prop"] as! String
                 print("property extracted: \(prop)")                
              }
          }             
      },
      failure: {
          (operation: AFHTTPRequestOperation!, error: NSError!) in
          print("Error: " + error.localizedDescription)
                
      }
)