A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label networking. Show all posts
Showing posts with label networking. Show all posts

smbclient commands on linux

# List all shares
smbclient -L '\\\\server-name' -U username -W DOMAIN

# Logs into server to type commands
smbclient '//server-name/sharename$' -U username -W DOMAIN

# Logs in, runs 'ls' command and disconnects

smbclient '//server-name/sharename$' -U username -W DOMAIN -c ls

# Other parameters:
-d99 = debug output
-D directory = start from directory

# Commands
get = just like FTP



See also smb2www (perl) and smb2www (c).


Fix hanging network-manager applet in Ubuntu 11.04

#!/bin/bash

# Fix the frozen network-manager applet
# Thanks to http://askubuntu.com/questions/23611/network-manager-applet-menu-freezes-and-does-not-respond

killall nm-applet
sudo /etc/init.d/network-manager restart
nm-applet &> /dev/null &

SSH on Blackberry

MidpSSH

I want to use SSH on my Blackberry, for example with the program MidpSSH.
I am using a Blackberry 8900 on the Orange UK network.

When I try to connect to a server using MidpSSH, I get the error: "Session error: Writer: Invalid parameter".
Apparently I need to set my APN to fix this. What is an APN? List of APNs

On my device in Options | Advanced Options | TCP/IP there's a tickbox for "APN Settings Enabled".
There I can set APN: orangeinternet But this doesn't help. Tried rebooting.

Perhaps it won't work because:
Orange would have had to setup the normal Orange GPRS APN on your account, ... which they don't do for blackberry users (understandably, we're all meant to use BIS).
(I can also see in Advanced Options | Host Routing Table, all the "Host Routing Information" entries have APN: blackberry.net)


Orange


UPDATE 10/09/10:
I called Orange and spoke to the "online services" team (439). A nice man called Ben (CMTS Darlington) found some instructions on their system for using SSH from a Blackberry. They recommended downloading the client from xk72.com. But then he spoke to the 2nd line support team for me and they said that SSH is "Not supported anymore".
Well, what does that mean? That I won't be able to get an SSH connection? Or that I will be able to get a connection, but they won't give me any help should a problem arise? How do I know if their system is working properly for me to try and make an SSH connection?

Here's an unrelated typical example of poor Orange customer service.

PaderSyncSSH

I tried connecting with PaderSyncSSH free trial from the Blackberry App Store.

When I set the Networking connection type in 'Misc. Settings' to "Direct TCP", and set my APN to orangeinternet, I get the error: Connect failed: Error opening socket. java.io.IOException: Peer refused the connection. (Note: This is the same message as I get when connecting to a server that does not offer SSH).
With Networking connection type 'BES/MD5' I got the error: Connect failed: Error opening socket. java.io.IOException: Invalid URL parameter (that's the same as MidpSSH!)
With Networking connection type 'BIS-B' I got the error: Connect failed: Connect failed. ab: Session.connect: java.io.IOException: BIS-B connection failed. (and a recommendation to try Direct-TCP, or have the server listen on a port above 1024 because some carriers block lower ports).

UPDATE 14/09/10:
After connecting once via wifi, I tried connecting to an SSH server via Orange's GRPS phone data network again, and it worked perfectly. Success! I discovered that sometimes I get the error "Connect failed: Error opening socket. java.io.IOException: Peer refused the connection", but other times it works just fine.




Telnet

I succeeded in making a telnet connection to bbc.co.uk:80 through GPRS and issuing a GET HTTP/1.1 command, which resulted in the HTML text of the BBC homepage.



Wifi

I succeeded in using PaderSyncSSH SSHing to shellmix.com:30 (newuser/newuser) when I connected my BlackBerry to a wifi network. It worked really well! MidpSSH gave the same error (but then it doesn't have a network type selection option like PaderSync does).


Remove all login restrictions for MySQL

Start mysqld (or mysqld_safe) with the --skip-grant-tables option

How to get your subdomains to resolve

Mac:
  • The wrong way: Edit /etc/hosts
  • The right way: Add subdomains to your network preferences 'Search domains' (in TCP/IP tab)

Windows:
  • No idea - someone please tell me

Ping a host, then sleep and loop in Windows

@echo off
for /L %%a in (1,1,2016) do (
date /t
time /t
ping -n 30 yahoo.co.uk
ping localhost -n 360 > nul
)

Pipe this into a file to test your internet connection.
It pings yahoo.co.uk 30 times, then sleeps for 5 minutes.
It repeats 2016 times; That is one week.

Edit text files on remote linux servers

UNTESTED:

> I've never managed to figure out how to rig up editors to edit
> files on remote servers.

On the server, put this in smb.conf

[homes]
comment = Home Directories
hide dot files = yes
read only = No
browseable = yes


Then in the finder/windows explorer connect to 'smb://hostname/' . Then make an alias to it on your desktop.

Alternatively, TextWrangler on the Mac has an ftp/sftp browser.

http://www.barebones.com/products/TextWrangler/