- General (18)
- Food (1)
- Cooking (1)
- Ruby (6)
- Rails (2)
- Svn (2)
- Linux (9)
- Git (1)
- Firefox (8)
- Porn (1)
- Freyja (1)
- Witchhammer (6)
- Music (1)
- Merb (3)
- Poetry (0)
- Bolverk (3)
- Sinatra (1)
- Discogs (1)
- Centos (1)
- Python (1)
- Whinging (2)
- Travel (2)
- Scheme (7)
- Lisp (8)
- Sicp (1)
- Rot13 (1)
- Czech (2)
- Metal (3)
- Passenger (1)
- Fun (5)
- Fractals (2)
- Plt (2)
- Clojure (1)
- Continuations (1)
- Presentation (1)
Note to self: smbclient
List the available shares:
$ smbclient -U my_user -L samba_hostname
Choose the share you want, and connect:
$ smbclient -U my_user //samba_hostname/Share_Name
If you get "Not enough '\' characters", do not just keep adding them! You probably want to shuffle your arguments around (such as putting -L last).
To turn off those annoying prompts on an mget, just toggle it:
Let me do it, Python!
Python is great. It's nearly at the top of my list of "most usable" programming languages.
But one thing annoys me. It's even been explained in detail, and it still annoys me!
Basically, the join() method is defined on the string class and not on the list/tuple class. Now, I admit, it's not really that big of a deal. It's hardly going to make me drop Python into the abyss of "tried, but shitty" languages.
When I was first learning Python, I knew that joining a list/array of strings on a specific delimiter would be part of the standard library. Here is what I tried:
["Balls", "to", "the", "walls"].join(", ")
But, no! Python makes me do this:
", ".join(["Balls", "to", "the", "walls"])
Eww! It's both backwards and ugly! Let me do it by way, Python! In Ruby, I could just duckpunch the hell out of the class and implement my own method. But thats another story...
The thing that bothers me the most is that you actually have to pass a list into the method. If the join method must be on string, then I should atleast be able to pass in an arbitrary number of arguments, like so:
", ".join("Balls", "to", "the", "walls")
I mean, Python does support optional arguments, after all. And if I have a list I want to join, I could just apply the list as arguments:
# Doesn't work... args = ["Balls", "to", "the", "walls"] ", ".join(*args)
One other thing that (slightly) bothers me is that it also forces me to pass in a list of string objects. Being dynamically-typed and very-high-level, I would have expected Python to forcfully stringify any non-string members of the supplied list.
", ".join(["Balls", 2, "the", "Walls"]) => ERROR!
C'mon, Python. You already give me the option of writing questionable code by allowing me to access private instance methods externally (Note: I've never done this).