Tag Archives: terminal

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

How To Enable Color in Terminal on Mac OS X for Root

This method will work for all users on your system, because you will be editing the system-wide profile and not a user-specific one. Step 1: Edit /etc/profile You will need to have root privileges to do this. You can open the file in TextEdit by going to File->Open and when the dialog pops up press Command-Shift-G to open the “Go to Location” dialog, then type in /etc/profile. Open the file called “profile” which should now be highlighted in your list of files. After opening that file, add the following two lines to the bottom: export CLICOLOR=1 export LSCOLORS=ExFxBxDxCxegedabagacad The colors can be configured as stated in the ls manual, which can be accessed in terminal via “ls man” Look for the section LSCOLORS. Here is what it says about the colors you can use to configure the display: LSCOLORS The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. The color designators are as follows: a black b red c green d brown e blue f magenta g cyan h light grey A bold black, usually shows up as dark grey B bold red C bold green D bold brown, usually shows up as yellow E bold blue F bold magenta G bold cyan H bold light grey; looks like bright white x default foreground or background Note … Continue reading

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