Tag Archives: cli

Does Amazon ec2 have “Get System Log” for the command line (CLI) API?

Yes! I didn’t realize this at first. I was searching for API tool for getting system log and ec2 command line system log and I even looked at all the ec2 command looking for the word log – but there is a trick. If you want to be able to grab the data that you grab via the web interface at console.aws.amazon.com: I hope this answer the following questions: ec2 “get system log” command line ec2 “get system log” command line ec2 cli system log ec2 get system log amazon ec2 api get system log amazon ec2 system tools Then you need to use the following ec2 command: ec2-get-console-output SYNOPSIS ec2gcons ([ec2-get-console-output]) ec2gcons [GENERAL OPTIONS] [-r] INSTANCE GENERAL NOTES Any command option/parameter may be passed a value of ‘-‘ to indicate that values for that option should be read from stdin. DESCRIPTION Display the instance’s console output. The INSTANCE parameter is the ID of the instance’s console to retrieve. SPECIFIC OPTIONS -r, –raw-console-output Raw output. Do not escape the console output. If not specified ^ESC is escaped and multiple blank-lines are folded into one.

Posted in Uncategorized | Tagged , , | Leave a comment

Send Folders to CodeKit via the Command Line

If you’re doing some web development with CodeKit and want to be able to send folders to the program via the command line (I was really hoping to do this via Quicksilver), then you can use this little tidbit: open -a /Applications/CodeKit.app “/path/to/your/project” The CodeKit application apparently does not associate itself with being able to open files and so it doesn’t register with folders or files as being an available “Open With” application for opening them. Again I was hoping to do this via a quicksilver action, something like: If it did then quicksilver would stick it in the third pane when using the “Open With” action, wouldn’t that be nice! It is possible to get it into the third pane but you need to have the path to the application in your clipboard (/Applications/CodeKit.app) and then: Select the Folder Choose “Open With” Tab to the third pane and paste the path to the application in. That’s demonstrated in the screenshot above. CodeKit’s not too bad, some aspects seem sluggish and I wish there were more features to customize it – like inclusion and exclusion rules and a finer grained control of which tabs refresh in the browser – also maybe some explanation of their partial CSS injection-on-update feature they have in the preferences.

Posted in Mac, Tech Tips, Web Development | Tagged , , , , | Leave a comment

ValueError: No JSON object could be decoded – cuTorrent

cuTorrent is a simple command-line tool that interacts with remote uTorrent instances through thier webui. To use cuTorrent you must have uTorrent running with the webUI on. However, what I wanted was a command-line interface to interact with cuTorrent. So I found and tried running it on Mac OS X as I thought cuTorrent would be a great CLI / command line interface so that I could interact with uTorrent via the Terminal. After running it I got errors like ValueError: No JSON object could be decoded and also: $ ./cuTorrent.py -a list -p 56426 cuTorrent By: Saul Bancroft <saul .[email protected]> +list+ Traceback (most recent call last): File “./cuTorrent.py”, line 270, in <module> main() File “./cuTorrent.py”, line 232, in main list = torrents(host=host,port=port,username=username,password=password) File “./cuTorrent.py”, line 112, in __init__ self.update() File “./cuTorrent.py”, line 115, in update l = self.connection.webui_ls() File “/private/tmp/tmp/cutorrent.1.0.beta1.tar/cutorrent/uTorrent_py/uTorrent.py”, line 203, in webui_ls return self.webui_action(r’/gui/?list=1′)[‘torrents’] File “/private/tmp/tmp/cutorrent.1.0.beta1.tar/cutorrent/uTorrent_py/uTorrent.py”, line 135, in webui_action return simplejson.loads(webui_response.read()) File “/private/tmp/tmp/cutorrent.1.0.beta1.tar/cutorrent/simplejson/__init__.py”, line 201, in loads return cls(encoding=encoding, **kw).decode(s) File “/private/tmp/tmp/cutorrent.1.0.beta1.tar/cutorrent/simplejson/decoder.py”, line 249, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File “/private/tmp/tmp/cutorrent.1.0.beta1.tar/cutorrent/simplejson/decoder.py”, line 268, in raw_decode raise ValueError(“No JSON object could be decoded”) ValueError: No JSON object could be decoded Since the project on GoogleCode had not been updated in several years, I started looking into rTorrent which is natively a CLI torrent program. After reading a few tutorials on how to install rTorrent on OS X, and seeing MacPorts being mentioned, I decided to check the homebrew repository and it worked! My solution … Continue reading

Posted in Mac | Tagged , , , | Leave a comment

nmap scans ips and ports

A useful linux/unix tool, nmap scans ips and ports of given hosts: Nmap 5.21 ( http://nmap.org ) Usage: nmap [Scan Type(s)] [Options] {target specification} TARGET SPECIFICATION: Can pass hostnames, IP addresses, networks, etc. Ex: scanme.nmap.org, 192.168.0.1; 10.0.0-255.1-254 -iL <inputfilename>: Input from list of hosts/networks -iR <num hosts>: Choose random targets –exclude <host1 [,host2][,host3],…>: Exclude hosts/networks –excludefile <exclude_file>: Exclude list from file HOST DISCOVERY: -sL: List Scan – simply list targets to scan -sP: Ping Scan – go no further than determining if host is online -PN: Treat all hosts as online — skip host discovery -PS/PA/PU/PY[portlist]: TCP SYN/ACK, UDP or SCTP discovery to given ports -PE/PP/PM: ICMP echo, timestamp, and netmask request discovery probes -PO[protocol list]: IP Protocol Ping -n/-R: Never do DNS resolution/Always resolve [default: sometimes] –dns-servers <serv1 [,serv2],…>: Specify custom DNS servers –system-dns: Use OS’s DNS resolver –traceroute: Trace hop path to each host SCAN TECHNIQUES: -sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans -sU: UDP Scan -sN/sF/sX: TCP Null, FIN, and Xmas scans –scanflags <flags>: Customize TCP scan flags -sI <zombie host[:probeport]>: Idle scan -sY/sZ: SCTP INIT/COOKIE-ECHO scans -sO: IP protocol scan -b <ftp relay host>: FTP bounce scan PORT SPECIFICATION AND SCAN ORDER: -p <port ranges>: Only scan specified ports Ex: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080 -F: Fast mode – Scan fewer ports than the default scan -r: Scan ports consecutively – don’t randomize –top-ports <number>: Scan </number><number> most common ports –port-ratio <ratio>: Scan ports more common than </ratio><ratio> SERVICE/VERSION DETECTION: -sV: Probe open ports to determine service/version info –version-intensity <level>: … Continue reading

Posted in Security, Server Admin, Tech Tips | Tagged , , , | Leave a comment

Dropbox Command Line Interface (CLI)

Posted in Software, Tech Opinion | Tagged , , , | 1 Comment