Welcome to zewaren.net. This site presents myself and mostly archives the solutions to some problems I once had.

smbclient can't list shares of windows 7

Not so frequently asked questions and stuff: 

Problem:
smbclient can't list the shares of a windows 7 box, even if smbmount can without problem.

$ smbclient -L //SOMEBOX -I 192.168.xx.yy
Enter someones's password: 
Anonymous login successful
Domain=[REZID] OS=[Windows 7 Professional 7600] Server=[Windows 7 Professional 6.1]

        Sharename       Type      Comment
        ---------       ----      -------
Error returning browse list: NT_STATUS_ACCESS_DENIED
Anonymous login successful
Domain=[REZID] OS=[Windows 7 Professional 7600] Server=[Windows 7 Professional 6.1]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------

You are running a version of samba with a problem.
https://bugzilla.samba.org/show_bug.cgi?id=7577

$ smbclient --version
Version 3.3.2

Update samba to latest 3.4 or 3.5 or patch your current and enjoy.

 smbclient -L \\SOMEBOX -I 192.168.xx.yy
Enter root's password: 
Domain=[SOMEBOX] OS=[Windows 7 Professional 7600] Server=[Windows 7 Professional 6.1]

   Sharename       Type      Comment
   ---------       ----      -------
   ADMIN$          Disk      Administration à distance
 C$              Disk      Partage par défaut
    F$              Disk      Partage par défaut
    I$              Disk      Partage par défaut
    IPC$            IPC       IPC distant
   Share 1       Disk      
    Share 2         Disk      
  Share 3      Disk      
Domain=[SOMEBOX] OS=[Windows 7 Professional 7600] Server=[Windows 7 Professional 6.1]

    Server               Comment
    ---------            -------

    Workgroup            Master
 ---------            -------

Don't forget to update libsmbclient and libsmbclient-dev if you are using them.Problem:
smbclient can't list the shares of a windows 7 box, even if smbmount can without problem.

$ smbclient -L //SOMEBOX -I 192.168.xx.yy
Enter someones's password: 
Anonymous login successful
Domain=[REZID] OS=[Windows 7 Professional 7600] Server=[Windows 7 Professional 6.1]

        Sharename       Type      Comment
        ---------       ----      -------
Error returning browse list: NT_STATUS_ACCESS_DENIED
Anonymous login successful
Domain=[REZID] OS=[Windows 7 Professional 7600] Server=[Windows 7 Professional 6.1]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------

You are running a version of samba with a problem.
https://bugzilla.samba.org/show_bug.cgi?id=7577

$ smbclient --version
Version 3.3.2

Update samba to latest 3.4 or 3.5 or patch your current and enjoy.

 smbclient -L \\SOMEBOX -I 192.168.xx.yy
Enter root's password: 
Domain=[SOMEBOX] OS=[Windows 7 Professional 7600] Server=[Windows 7 Professional 6.1]

 Sharename       Type      Comment
   ---------       ----      -------
   ADMIN$          Disk      Administration à distance
 C$              Disk      Partage par défaut
    F$              Disk      Partage par défaut
    I$              Disk      Partage par défaut
    IPC$            IPC       IPC distant
   Share 1       Disk      
    Share 2         Disk      
  Share 3      Disk      
Domain=[SOMEBOX] OS=[Windows 7 Professional 7600] Server=[Windows 7 Professional 6.1]

    Server               Comment
    ---------            -------

    Workgroup            Master
 ---------            -------

Don't forget to update libsmbclient and libsmbclient-dev if you are using them.

How to remove all the windows 6.x 6to4 adapter automatically

Not so frequently asked questions and stuff: 

You can remove them manually in the device manager (be sure to click "Show hidden devices").

Or you can use devcon.

devcon remove @ROOT\*6TO4MP\*

Source:

  • http://support.microsoft.com/kb/311272

Create a cacher for APT with apt-cacher.

Not so frequently asked questions and stuff: 
apt-get install apt-cacher

In sources.list:

#repository:
deb http://example.debian.org/debian unstable main contrib non-free 
#becomes:
deb http://repository-cache:3142/example.debian.org/debian unstable main contrib non-free 

Or in apt.conf:

#Use cache:
Acquire::http::Proxy "http://repository-cache:3142/";
#Don't use cache for security.ubuntu.com
Acquire::http::Proxy::security.ubuntu.com "DIRECT";

Check it with:

apt-config dump

Sources:

Create a complete solid cylinder with GLUT.

Not so frequently asked questions and stuff: 

Code:

//Output a cylinder with both lids.
//Erwan Martin 
#define SOLID_CLOSED_CYLINDER(QUAD, BASE, TOP, HEIGHT, SLICES, STACKS) \
gluCylinder(QUAD, BASE, TOP, HEIGHT, SLICES, STACKS); \
glRotatef(180, 1,0,0); \
gluDisk(QUAD, 0.0f, BASE, SLICES, 1); \
glRotatef(180, 1,0,0); \
glTranslatef(0.0f, 0.0f, HEIGHT); \
gluDisk(QUAD, 0.0f, TOP, SLICES, 1); \
glTranslatef(0.0f, 0.0f, -HEIGHT);

Usage:

  GLUquadric *quadric = gluNewQuadric();
  gluQuadricDrawStyle(quadric, GLU_FILL);
  gluQuadricOrientation(quadric, GLU_INSIDE);
  SOLID_CLOSED_CYLINDER(quadric, 0.17f, 0.17f, 0.15f, 20, 20)
  gluDeleteQuadric(quadric);

Reference:

  • http://www.eclipse.org/articles/Article-SWT-OpenGL/opengl.html
  • http://www.dei.isep.ipp.pt/~matos/cg/docs/manual/gluCylinder.3G.html

How to parse CSV data with Regular Expressions.

Not so frequently asked questions and stuff: 

The following regexp will return the different fields in a CVS row:

/((?:,|^)(?!,)(?:"(.*?(?

Here is an example in PHP:


Output:
Array
(
    [0] => zerzer
    [1] => abcd
    [2] => sd(fsdf"dsfsfsd
    [3] => sdf,e)zr,ertnfdg
    [4] =>
    [5] =>
    [6] =>
    [7] => ssfsdfsdf
    [8] => sdfsdfsdf
    [9] => sfsdfs
)

How to display output in more than one window with VLC Media Player.

Not so frequently asked questions and stuff: 

Cloning

To display output in more than one window, video cloning can be used. To use this, specify

--vout-filter=clone

on the command line: this tells vlc to use cloning. You also need to tell vlc what output modules you want with, for example,

--clone-vout-filter=caca,glx
--clone-count=2

Source: http://wiki.videolan.org/Video_Output

Software profile : tmux

Here is my tmux profile files. I use them mainly on FreeBSD.

Simple configuration

Tmux configuration: simple

.tmux.conf

#~/.tmux.conf
#revision 100829
set-window-option -g mode-keys vi

#set -g default-terminal "screen-256color"
set -g history-limit 1000

set -g status-left '#H:'
set-window-option -g window-status-current-fg red
#set -g status-bg black
#set -g status-fg white

unbind C-b
set -g prefix C-a

unbind C-t
bind C-t new-window

bind C-a last-window

unbind NPage
bind NPage next-window
unbind PPage
bind PPage previous-window

unbind C-[
bind-key = copy-mode

unbind C-]
bind-key ) paste-buffer

#set-option -g mouse-select-pane on
#setw -g mode-mouse on

Advanced configuration: user

Image

.tmux.conf

#~/.tmux.conf
#revision 121001
set-window-option -g mode-keys vi

#set -g default-terminal "screen-256color"
set -g history-limit 1000

# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green

set-option -g status on
set-option -g status-utf8 on
set-option -g status-interval 2
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-right "#(~/.tmux.status_right.sh)"
set-option -g status-left  "#(~/.tmux.status_left.sh)"
#set-window-option -g window-status-current-fg red
#set -g status-bg black
#set -g status-fg white

unbind C-b
set -g prefix C-a

unbind C-t
bind C-t new-window

bind C-a last-window

unbind NPage
bind NPage next-window
unbind PPage
bind PPage previous-window

unbind C-[
bind-key = copy-mode

unbind C-]
bind-key ) paste-buffer

.tmux.status_left.sh

#!/bin/sh
HOSTNAME=`hostname`
WHOAMI=`whoami`

echo -n "#[fg=colour234, bg=colour27]$HOSTNAME \
#[fg=colour27, bg=colour33]⮀#[fg=colour0,bg=colour33] $WHOAMI \
#[fg=colour33, bg=colour235]⮀ \
"

.tmux.status_right.sh

#!/bin/sh
IP4ETH0=`ifconfig em0 | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'`
DATE1=`date +'%a'`
DATE2=`date +'%Y-%m-%d'`
DATE3=`date +'%H:%M'`

echo -n "#[fg=colour237, bg=colour235]⮂\
#[fg=colour97, bg=colour237] $IP4ETH0 ⮃ 91.217.154.93 \
#[fg=colour235, bg=colour237]⮂#[fg=colour136, bg=colour235] $DATE1 ⮃ $DATE2 ⮃ $DATE3 \
"

Advanced configuration: root

Image

.tmux.conf

#~/.tmux.conf
#revision 121001
set-window-option -g mode-keys vi

#set -g default-terminal "screen-256color"
set -g history-limit 1000

# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green

set-option -g status on
set-option -g status-utf8 on
set-option -g status-interval 2
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-right "#(~/.tmux.status_right.sh)"
set-option -g status-left  "#(~/.tmux.status_left.sh)"
#set-window-option -g window-status-current-fg red
#set -g status-bg black
#set -g status-fg white

unbind C-b
set -g prefix C-a

unbind C-t
bind C-t new-window

bind C-a last-window

unbind NPage
bind NPage next-window
unbind PPage
bind PPage previous-window

unbind C-[
bind-key = copy-mode

unbind C-]
bind-key ) paste-buffer

.tmux.status_left.sh

#!/bin/sh
HOSTNAME=`hostname`
WHOAMI=`whoami`

echo -n "#[fg=colour234, bg=colour124]$HOSTNAME \
#[fg=colour124, bg=colour196]⮀#[fg=colour0,bg=colour196] $WHOAMI \
#[fg=colour196, bg=colour235]⮀ \
"

.tmux.status_right.sh

#!/bin/sh
IP4ETH0=`ifconfig em0 | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'`
DATE1=`date +'%a'`
DATE2=`date +'%Y-%m-%d'`
DATE3=`date +'%H:%M'`

echo -n "#[fg=colour237, bg=colour235]⮂\
#[fg=colour97, bg=colour237] $IP4ETH0 ⮃ 91.217.154.93 \
#[fg=colour235, bg=colour237]⮂#[fg=colour136, bg=colour235] $DATE1 ⮃ $DATE2 ⮃ $DATE3 \
"

ZeWaren / Erwan Martin

About me

My name is Erwan Martin, a French computer science / IT engineer and entrepreneur.

Meet me on the following social networks:

Github GitHub https://github.com/ZeWaren
Twitter Twitter http://twitter.com/#!/ZeWaren/
Stack Exchange Stack Exchange Careers http://careers.stackoverflow.com/zewaren
Flickr Icon Flickr http://www.flickr.com/photos/45525217@N02/
Dealabs Dealabs http://dealabs.com/16/ZeWaren

You can contact me different ways:

Jabber Icon Jabber/XMPP zewaren [AT] enceinte.tf
Image Email public [AT] fzwte.net

About this website

This website is self-hosted on a nice FreeBSD server, and it does not include any ads or trackers. Its first version was published around 2004 and its latest version was released in 2010.

XSLT - How To Change the URL of a Namespace

Not so frequently asked questions and stuff: 

Problem

You've got an XML document, like this one:

 some content 

However, the person who wrote it didn't know that the true identifier of the namespace of the document is not http://zewaren.net/old_location/, but rather http://zewaren.net/new_location/. So you need a style sheet to update the url.

Solution

This style sheet will re-output all the elements and attributes of the old namespace, and assign them a new namespace with the correct URL.

Création d'un programme de générarion de mosaique de texte en dotNET. (2005)

Articles en Français: 

Création d'un programme de générarion de mosaique de texte en dotNET. (2005)
French
Hosted by developpez.com
http://zewaren.developpez.com/dotnet/textmosaic/

Pages

Subscribe to Front page feed