Challenges that each developer faces every day

Tuesday, February 9, 2010

Problems Creating Samba User on Fedora Core 12

The Problem

Summary: TB08997608 connection.py:630:call_blocking:DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Traceback (most recent call last):
  File "/usr/share/system-config-samba/addUserWin.py", line 174, in on_add_user_ok_button_clicked
    elif self.samba_backend.userExists(unix_name):
  File "/usr/lib/python2.6/site-packages/scsamba/dbus/proxy/sambaBackend.py", line 88, in userExists
    return self.dbus_interface.userExists (user)
  File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Local variables in innermost frame:
byte_arrays: False
self:
args: ('admin',)
utf8_strings: False
bus_name: dbus.UTF8String(':1.107')
get_args_opts: {'byte_arrays': False, 'utf8_strings': False}
object_path: '/org/fedoraproject/Config/Samba/Backend'
timeout: -1.0
signature: u's'
dbus_interface: 'org.fedoraproject.Config.Samba.Backend'
message:
method: 'userExists'

The Solution

start a Terminal (Applications > System Tools > Terminal) and then switch to root and execute the command /usr/bin/system-config-samba

admin@dev ~]$ su
Password: ....type your root password...
[root@dev admin]# system-config-samba
when you add a user (e.g. admin samba user) you should see an output such as:
Added user admin.

Before doing that I enabled and started smb and nmb services from System > Administration > Services
maybe that helped as well.
I also deactivated SE Linux and Disabled the Firewall (!)
Regarding the Firewall try to experiment with it enabled and only allow samba ports.
If you don't have another firewall before the Fedora server don't disable the firewall!!!
Consult your sysadmin so you don't expose unnecessary services.

Related
  • http://www.linuxquestions.org/questions/linux-software-2/samba-crashes-775289/
  • http://www.google.ca/search?q=Samba+DBusException%3A+org.freedesktop.DBus.Error.NoReply%3A+Did+not+receive+a+reply.+Possible+causes+include%3A+the+remote+application+did+not+send+a+reply&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

 Digg  Del.icio.us  Reddit  SlashDot

Tuesday, January 26, 2010

php fsockopen unable to connect ssl extension under Windows XP/Vista

I've been testing with PayPal sandbox on my Windows Vista machine.
It is running Apache/2.0.59 (Win32) PHP/5.2.12
My php is installed in c:\php5 yours could be in c:\php

My goal was to use fsockopen with "ssl://" stream but I was receiving this error:

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.sandbox.paypal.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)
My Solution

1. I had to enable: php_openssl.dll from php.ini

extension=php_openssl.dll

2. I also made sure that extension_dir points to my extension directory, not the default ./ location.

extension_dir = "c:/php5/ext"

3. I found the comment of mtudor AT icefusion DOT co uk very valuable.
I renamed these 2 files so the same files are loaded from c:\php5

C:\Apache2\bin\ssleay32.dll => old-ssleay32.dll
C:\Apache2\bin\ssleay32.dll => old-libeay32.dll

If everything is OK your phpinfo(); should list these stream socket transports
Registered Stream Socket Transports     tcp, udp, ssl, sslv3, sslv2, tls
Related

Good luck!
Svetoslav

 Digg  Del.icio.us  Reddit  SlashDot

Saturday, January 23, 2010

svn error can't read length line in file

It seems my ubuntu running box has crashed and first my shadow file was empty then SVN had its own problems. It pays so much for one to be patient.

Useful commands:

svnadmin recover /var/svn/repo
svnadmin verify /var/svn/repo
Related

 Digg  Del.icio.us  Reddit  SlashDot

Friday, January 22, 2010

How to add a current date in Google docs

I've always wanted to know how can I insert the current date.
I know it's pretty basic but I am a programmer and therefore lazy (in a positive way) I like to do things once and automate as much as possible :)

There is a pretty good discussion here and jayperk's comment seems to be the best one.

For DOCUMENTS, not spreadsheets, insert a comment( CTL-M), then right click comment and select "add comment to document". This works for things like Journals etc.

 Digg  Del.icio.us  Reddit  SlashDot

Tuesday, December 22, 2009

How to add images to a dropdown created with formSelect (Zend Framework View Helper)

How to add images to a dropdown created with formSelect (Zend Framework View Helper)

I know it's nice when to have images in an html dropdown menu.
We're going to use Marghoob Suleman's image combobox v2.1
This jQuery plugin requires that the dropdown's <option>...</option> to contain an attribute called "title" which points to an image location.
I suggest using small icons e.g. 16x16, 20x20, 24x24 or 32x32 however it's up to you and your project's requirements.

In Zend Framework's formSelect view helper we can pass attributes to the <select>...</select> but not to the <option>...</option> so we have to do some prep-work with jQuery before hand.
Our prep-work will basically iterate through selected dropdown's options and adds the title="" attribute to each of them.
Here is an example for a language dropdown.
I am assuming that images are saved in /images/flags/ and are named properly e.g. "language_code"_"COUNTRY CODE".png

For Example:
    en_US.png -> for American English
    en_CA.png -> for Canadian English
    fr_CA.png -> for Canadian French

... in the controller

        $langs_dropdown = array(
            'en_US' => 'English (US)',
            'en_CA' => 'English (Canada)',
            'bg' => 'Bulgarian',
        );

        $this->view->mod_lang_code = 'en_CA';
        $this->view->mod_lang_dropdown = $langs_dropdown;


... the lines below go in the view file however do change the paths to match your directory structure.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/scripts/jquery/plugins/jquery-image-dropdown-2.1/msdropdown/js/jquery.dd.js"></script>
<link rel="stylesheet" type="text/css" href="/scripts/jquery/plugins/jquery-image-dropdown-2.1/msdropdown/dd.css" />


<script type="text/javascript">
jQuery(document).ready(function() {
    // Some prep-work
    jQuery("#mod_lang_code option").each(function (index, obj) {
        img_web_path = '/images/flags/';
        img_ext = '.png';

        // We want to insert 'title' attrib for each select option
        // so the other plugin can make icons to appear
        if (jQuery(obj).val() != '') {
            jQuery(obj).attr("title", img_web_path + jQuery(obj).val() + img_ext);
        }

    });

    jQuery("#mod_lang_code").msDropDown();
});
</script>


<!-- Lang -->
<div>
    <?php echo $this->formSelect("mod_lang_code", $this->mod_lang_code,
    array('style' => 'width: 180px;', 'onchangeINACTIVE' => 'alert("hi.this.is.the.onchange.event");'), $this->mod_lang_dropdown); ?>
</div>
<!-- /Lang -->

The result should look like this




Related

 Digg  Del.icio.us  Reddit  SlashDot

Monday, December 21, 2009

How to quickly make form fields wider with css and jQuery

Form fields can be not wide enough. Here are solution that will enable you quickly to make them wider.

    <script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('input:text,input:password,select').attr('style', 'width: 350px;');
        jQuery('input:password').attr('style', 'width: 300px;');
        jQuery('select').attr('style', 'width: 300px;');
    });
    </script>


OR
   
    <script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('input:text,input:password,select').attr('style', 'width: 350px;');
    });
    </script>


OR

You could add a common class if you want:

    <script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('input:text,input:password,select').addClass('some_cls');
    });
    </script>

 Digg  Del.icio.us  Reddit  SlashDot

Sunday, December 20, 2009

Apple Fans!

I was just checking facebook and found this funny picture :)


Source:








 Digg  Del.icio.us  Reddit  SlashDot