Sunday, March 29, 2009

Creating Samba shares with no username or password in Ubuntu Linux

Samba sometimes frustrates me. It seems to be very picky about under what circumstances it will actually let you broadcast the existence of your Linux machine on your LAN, and share a folder with read and write permissions for other Linux or Windows users to see.

After a little tinkering, here's how I went about doing just that.

(thanks to http://www.debuntu.org/guest-file-sharing-with-samba) for most of the tips)

********

(1) Make sure you have Samba installed. As far as I remember, it is included with most distributions, but just in case, try this --

sudo apt-get install samba

(2) Now you need to modify the Samba configuration file located at /etc/samba/smb.conf and make some changes to remove the necessity to type in a username and password every time you wish to access a share. Run --

sudo gedit /etc/samba/smb.conf

(3) At some point, you might want to share a folder that does not belong to you on the network. To allow this, under the [global] section of this file, add (copy + paste) the following line --

usershare owner only = False

(4) Find the variable "security" (in the global section) and ensure that it is set to "share". The security line should look like this --

security = share

(if you absolutely can't find the security variable anywhere, add it to the file under the global section)

(5) Find the variable "guest account" (in the global section) and ensure that is set to "nobody". The guest account line should look like this --

guest account = nobody

(if you absolutely can't find the guest account variable anywhere, add it to the file under the global section)

(6) One guide I found said that since you are making Samba security insecure, you should ensure that only your local network can access the Samba service. I personally did not end up keeping this line in my smb.conf, because I did not seem to have any success getting Samba up and running by adding this to the config file, but you can (and probably should) at least try this to make sure it works. So go ahead and add this in, and if you can't access Samba/any shares after finishing the guide, remove the line altogether (or make sure you have permitted the right interface to bind).

To try this, you need to set the interfaces variable to lo and your local network interface (e.g eth0, eth1, wlan0) and you need to specify that only these interfaces can bind

interfaces = lo eth0
bind interfaces only = true

(7) Now, smb.conf should be set. Restart the samba daemon like this --

sudo service samba restart

(8) At this point, you have two options to add a shared folder on your machine. There's the easy way, that actually seems to work, and there's the hard, theoretical way, that I havn't had any sucess why. I'll go over the easy way first.

The easy way to share a folder is similar to the way you share a folder in Windows. All you need to do is right click on the folder in the question, press "Sharing Options", and fill out the resulting dialog. I recommend the following options --



At this point, you should be done. Congratulations. You should be able to access your shared folder by browsing your workgroup from another machine (Windows or Linux-based).

As far as I know, the name of your server is the host name of your computer, truncated to 15 characters. For example, the host name of my computer is andrew-laptop-mint. I can access my samba shares from Windows, for example, with \\andrew-laptop-m\Share (for example). You can get your host name by simply opening up a terminal and typing in hostname.

EXTRA: Here's the hard, theoretical way to add a shared folder in Samba --

(1) Run the following --

sudo gedit /etc/samba/smb.conf

(2) Near the bottom of the file, or where the other entires of this sort seem to be, add the following text (replacing generic items I've written in with your own variables, of course)

[generic-share]
path = /folder/to/share
comment = Insert comment here
read only = no
available = yes
browseable = yes
writable = yes
guest ok = yes
public = yes
printable = no
share modes = no
locking = no


(3) Run this --

sudo service samba restart

(4) You should have a shared folder now, although I can't say I've had any success with this. What's even more interesting is that the "Sharing options" method I described above doesn't seem to add anything of this sort to smb.conf. I don't know what's going on, maybe someone can enlighten me.

Good luck!

Saturday, January 10, 2009

News Summary: Israel tells Gazans to brace for war escalation

Israel tells Gazans to brace for war escalation

http://hosted.ap.org/dynamic/stories/M/ML_ISRAEL_PALESTINIANS?SITE=VACUL&SECTION=HOME&TEMPLATE=DEFAULT

Basically, Israel is warning the people of Gaza to brace for more bloodshed in Gaza. The Israelis issued this note to the Gazans --

"The IDF (Israeli Defense Forces) is not working against the people of Gaza but against Hamas and the terrorists only," the leaflets said in Arabic. "Stay safe by following our orders."

Meanwhile many are protesting Israel's increasing violence against the region.

The other side of the story? Some say that Hamas is doing everything in its power to provoke Israel into killing as many Palestinian civilians as possible, in order to generate condemnation against the Jewish state. (http://www.nationalpost.com/news/story.html?id=1149129&p=3)

Friday, January 2, 2009

How to recover most/all of your JournalSpace posts/images using Google Cache

Hey all --

I just read on Slashdot how JournalSpace.com has had a serious database issue, resulting in the loss of all their users posts, images, personal data, and more.

Immediately, I thought, "Google cache probably took snapshots of may users posts, and maybe even some of their images. It's worth a shot running a sample query..."

So I ran a sample Google query on someone's JournalSpace username, and I was correct. It looks like all, if not most of your posts and maybe even images have been preserved by our big brother Google. For one sample query I did on a user, I got pages and pages of results!

Unfortunately, this method only works for people who did not have their blogs/journals set to be viewable only by other JournalSpace members, or set to Friends &/or Favorites only, and for other entries that were not set to private. Also, if people configured their blogs so that the googlebot, or other bots were blocked, they may have limited success in resurrecting old entries from the cache (thanks Charm for this info). So a lot of people may have limited or no success with these methods. For that group, I extend my sympathies. I know the feeling of losing so much personal data.

Assuming you didn't do any of the things above, try running a Google search like so --

site:your_journalspace_username.journalspace.com

Then, look for the link labeled "Cached" under any particular result, and you'll get Google's cached version.



For example, if I had a JournalSpace, I'd simply type in Google --

site:andrewtheart.journalspace.com

Other ideas for Google searches:
  • Get a particular post from an entryid (thanks Class Factotum)--
entryid site:your_username.journalspace.com
  • Get posts by date (examples)
site:your_username.journalspace.com "m=12" "y=2008"
site:
your_username.journalspace.com "y=2008"
  • Get comments from cached entries (thanks Charm) --
"your_username.journalspace.com" displaycomments
  • Get any page on JournalSpace with a reference to your name (may not work as intended/expected) --
your_user_name site:journalspace.com

There may be better ways to search Google for your cached posts. Experiment a bit and post your results here.

Some have also recommended using the Web Archive to look up old posts (thanks Frederick and Anon) -- http://www.archive.org/web/web.php. I tried using this, but it appears like the webmaster has blocked access to JournalSpace archives (at least temporarily). Maybe they couldn't handle the traffic. Give it a shot anyway.

You may want to try the Google cache trick quickly. I have a sinking suspicion Google may not like all this traffic.

You saw it here first. Good luck.

Andrew

Tuesday, December 23, 2008

Blank screen on startup after installing Ubuntu 8.10? Try this fix

Compiz (a fancy window manager for Linux) is probably causing the problem.

Reboot your computer. When GRUB pops up, it may say "Press ESC to enter menu", or alternatley you may be kicked to the menu if you have multiple OS's installed. Either way, when you get to the OS selection menu, select the menu option (kernel choice) that has the word "Recovery" in it.

Once that's loaded, choose the "drop to root terminal" option (to that effect, the exact wording may be different) from the imtimidating blue menu that pops up.

From there, type the following command.

Code:
sudo apt-get purge compiz compiz-core
Now reboot your computer just in case.

Hope that works...

Tuesday, August 19, 2008

Download a YouTube video using C#

I've posted the code to download a YouTube video using C# at PasteBin -

http://pastebin.com/f396257b6

Original credit goes here - http://krishnan.co.in/blog/post/download-videos-from-youtube-(C).aspx

Saturday, August 9, 2008

Visual C# 2008 Express Edition Setup Error - Setup has encountered a problem while trying to copy...

Recently, I was attempting to install Visual C# Express 2008 Edition on my Windows XP computer and got this error message after downloading the "Web Installer: -

Screenshot -








Error Text -

Setup has encountered a problem while trying to copy:
m:\\$shtdwn$.req
Press Retry to attempt the copy again. Press Cancel to cancel setup.


After reading some forum (can't find the web page again!), I determined that it was probably related to the fact that Windows had decided to use my ext3 formatted hard disk drive (mounted locally using Ext2 IFS) to extract temporary files to, and this was causing some issues with the installer. The easy solution is to simply download the Visual Studio Express Editions DVD ISO (link here should work, if not Google for "Offline Install), and either burn it to a DVD and run the installer that way, or use a ISO mounting utility like Daemon Tools to mount it in a virtual DVD Drive.

Hope this saves someone a little time.

Wednesday, July 2, 2008

Fixing rdp MIME type in Ubuntu Linux

If you've ever been presented with the problem of downloading a dynamically generated (or even static) rdp (Remote Desktop) file from within Firefox in Linux and you were optimistically expecting Firefox to recognize it and open it in some graphical interface like tsclient, you were probably sorely disappointed - you might have gotten a message like -

You have chosen to open
example.rdp
Which is a: BIN file

In this instance, you are only granted the option to Save the file to your computer.

To fix this, you need to configure Linux to automatically recognize this MIME type so that Firefox recognizes the file type as something besides binary (for some reason you can't directly add the recognition in Firefox without extensions).

To do this, you need to add the rdp MIME info into the file /etc/mime.types. Run the following two commands to quickly achieve this -

sudo -i
echo "application/x-rdp rdp" >> /etc/mime.types

This simply appends the rdp MIME info to the file.

Trying download a rdp file from Firefox now (you don't need to restart it). When the Save dialog pops up (and actually recongnizes the file type!), press the "Browse..." button to open the Application Helper selection dialog.

In the resulting window, locate the "Location" bar and type /usr/bin/tsclient (for example, if you have this installed). Press "Open" to continue. Firefox should now associate .rdp files with tsclient. Press "OK" on the open dialog to proceed.

The Terminal Services Client GUI will open. You may wish to change the various options using the tabular interface provided. This application is richer than the built in Windows Terminal Services client itself!

The next time you click on a n RDP file, Firefox should remember the association and ask you if you want to open the file in tsclient. If the "Open with" field in Firefox's Open dialog on attempts subsequent to this tutorial is blank, press "OK" regardless. tsclient should still launch.

Side note: to use tsclient, you need the packages

* tsclient
* rdesktop

So just

sudo apt-get install rdesktop tsclient