Archive for ‘CLI’ Category

Quickway to check your DNS settings under OSX

datePosted on 22:58, July 27th, 2007 by Many Ayromlou

This is another CLI command, so get your terminal ready. This gives you a quickway to check the DNS settings on OSX. Now one way is to just cat /etc/resolv.conf , but what if you wanted to see what the system is actually using (not just what it was configured for). Well scutil comes to rescue and gives us an interface to the “dynamic store” data maintained by configd. Here is the command:

scutil --dns
The output will list all four resolver your system is configured for. scutil is another one of those deep OSX commands, so I suggest you have a look at the manual for it (man scutil) or get on google and search for more details (Tech Zendo has a detailed article on how to perform actions during fast user switching, AFP548 also has a great article on how to setup NIC failover).

Share

OSX Directory Services from Command-line

datePosted on 19:42, July 27th, 2007 by Many Ayromlou

New day, new command. dscl is the command in question. It gives you access to Mac OSX’s Directory Services Command Line interface. Very powerful stuff for those of us who like the command line and hate to do the same task a million times. A useful example is the ability to grant Administrator privileges to a user from command line. Normally you would have to pull up System Preferences/Accounts/Click User and check the “Allow user to administrate this computer” box. Well not anymore….Here is how:

  • First you probably want to check who is an admin on the machine in question:
    • dscl . read /Groups/admin GroupMembership
  • Next you might want to add a user (we call him uberuser here) to the admin list:
    • dscl . append /Groups/admin GroupMembership uberuser
  • And maybe you want to revoke the admin privileges for user uberguber:
    • dscl . delete /Groups/admin GroupMembership uberguber
  • To see all the Directory information for user www:
    • dscl . -read /Users/www
  • To see all the Directory information about group admin:
    • dscl . -read /Groups/admin

There are probably a ton more things you can do with dscl, but that’s beyond the scope of this article (and my knowledge)…..so man dscl and have fun reading.

Share

How to set the Boot Volume from CLI in OSX

datePosted on 19:28, July 23rd, 2007 by Many Ayromlou

I’ve run into this issue a number of times a year, including today again, and I have to dig up the email I sent to myself last year with the command line in it. If, like us, you have a bunch of headless Xserves and you’re trying to (re)install OSX on them you might have run into this. How the heck do you change the boot volume to the CD/DVD in the drive when you have no keyboard/mouse access or remote desktop? Well turns out it’s quite simple (as usual). Just issue the command below from a ssh session (make sure the install CD/DVD is in the drive first):

  • Run diskutil list to make note of the CD drives partition number (usually /dev/disk1s2 if the system has one Hard drive only).
  • Run sudo bless –device /dev/disk1s2 –setBoot (You can also add –nextonly if you want to do this for just one boot cycle).
  • Run sudo reboot

You can also set a netboot server as your boot source:

  • Run sudo bless –netboot –server bsdp://255.255.255.255 (for subnet broadcast or specific IP address for specific netboot server).
  • Run sudo reboot

Bless the bless guy for blessing us with the bless tool :-)

Share

Good old TTY…

datePosted on 16:27, June 22nd, 2007 by Many Ayromlou


I love tty. I love command line. I love vi. Well if you agree with any one of these statements, you have to check out startty.com. It is absolutely simple and stunning at the same time. All you need is a telnet connection (you can even do it across serial terminals). Here is how it works:

- sign up for a account with a real email address.
- wait for confirmation email, click the link inside the email to confirm and create your startty account.
- login to startty.com website and goto the configuration screen to setup your panels.
- setup your 8 panels with different content
- bring up a terminal window and telnet to startty.com on port 50000 (telnet startty.com 50000)

Now go and grab the oldest computer you can find, hookup a wise terminal to it and amaze all your blogging/facebooking/rss’ing friends :-) TEXT TERMINALS RULES!!!

…..enjoy…..

Share

HDHomeRun: Multicast

datePosted on 14:58, May 28th, 2007 by Many Ayromlou

Using hdhomerun_config command you issue the following (after tuning into the channel ofcourse):

1) hdhomerun_config set /tuner0/target none
2) hdhomerun_config set /tuner0/channel qam:
a) hdhomerun_config set /tuner0/streaminfo
3) hdhomerun_config set /tuner0/program
4) hdhomerun_config set /tuner0/target

MCast Address is in range of: 224.0.0.0 –> 239.255.255.255

Share

HDHomeRun: Monitoring Signal Strength from command line

datePosted on 14:56, May 28th, 2007 by Many Ayromlou

The Windows GUI version of hdhomerun_config will display the signal strength and signal quality updating every second.

Under linux or osx you can use “watch” with hdhomerun_config:
hdhomerun_config FFFFFFFF get /tuner0/channel 8vsb:
watch hdhomerun_config FFFFFFFF get /tuner0/status

(If you have more than one HDHomeRun then specify the device ID rather than FFFFFFFF)

Share

HDHomeRun: Automatic Channel Scan from command line

datePosted on 14:53, May 28th, 2007 by Many Ayromlou

The CLI version of hdhomerun_config supports running an automatic channel scan.

The CLI version of hdhomerun_config can be downloaded from:
http://www.silicondust.com/forum/viewtopic.php?t=1923

Usage:

hdhomerun_config FFFFFFFF scan

For example:

OTA ATSC:
hdhomerun_config FFFFFFFF scan /tuner0
hdhomerun_config FFFFFFFF scan /tuner1

Digital Cable:
hdhomerun_config FFFFFFFF scan /tuner0
hdhomerun_config FFFFFFFF scan /tuner1

Share

HDHomeRun: To save the RAW TS stream to disk

datePosted on 14:52, May 28th, 2007 by Many Ayromlou

To save a 30 second unfiltered clip of a broadcast stream:

1) Use HDHomeRun Config (GUI) to choose the physical channel.
Ensure VLC is not running for the next commands…

2) Open a cmd prompt and change into the HDHomeRun program directory:
cd “C:\Program Files\Silicondust\HDHomeRun”

3) Set the filter:
hdhomerun_config FFFFFFFF set /tuner0/filter 0×0000-0x1FFE

4) Save the stream to disk:
hdhomerun_config FFFFFFFF save /tuner0 sample.ts

5) Wait 30 seconds and stop the stream by pressing Ctrl-C.

Share

You use hdhomerun_config to manually configure HDHomeRun to stream video to a PC running VLC…

You will need:

VLC – http://www.videolan.org/vlc/
hdhomerun_config – http://www.silicondust.com/forum/viewtopic.php?t=1923

1) Discover HDHomeRun

Run “hdhomerun_config discover” to find the HDHomeRun units on the local network.

If you have more than one HDHomeRun on your network then replace the wildcard FFFFFFFF Device ID in the examples with the Device ID of the HDHomeRun you wish to control.

2) Run a channel scan

hdhomerun_config FFFFFFFF scan /tuner0

3) Set the channel

Antenna:
hdhomerun_config FFFFFFFF set /tuner0/channel 8vsb:
Cable:
hdhomerun_config FFFFFFFF set /tuner0/channel qam:

Note that the channel is the physical ATSC channel, not the channel advertised by the TV station. Antennaweb.org is a good site for determining which stations are nearby and what physical channels they operate on: http://www.antennaweb.org/aw/Address.aspx

Check the signal strength using the following command:
hdhomerun_config FFFFFFFF get /tuner0/status

4) Select the program number

hdhomerun_config FFFFFFFF get /tuner0/streaminfo

hdhomerun_config FFFFFFFF set /tuner0/program

5) Launch VLC and open network stream
From the command line:
vlc udp://@:1234

From the GUI:
Launch VLC
File -> Open Network Stream
Choose UDP/RTP, Port 1234

6) Set the target for the video stream

hdhomerun_config FFFFFFFF set /tuner0/target :1234

Note that the target setting is automatically cleared if the target machine is not listening on the specified port. ie if VLC is not running or you quit VLC.

Troubleshooting

Check the signal strength using the following command:
hdhomerun_config FFFFFFFF get /tuner0/status

Check the target using the following command:
hdhomerun_config FFFFFFFF get /tuner0/target

If it reports “none” then most likely the pc was not listening on the target port and the ip/port was automatically cleared. Double check the following and then set the target again:
- Check that VLC is running and is using “udp://@” or “udp://@:1234″.
- Check the IP address of the machine VLC is running on.
- Check that the port is not blocked by a firewall.

If the target is correct and the LED on the HDHomeRun indicates it is streaming video then the most likely problem is a firewall blocking the port (UDP port 1234 used in this example).

Share
123Previous