Friday, December 27, 2013

file table is full on macos

ah, the mac which "just works".

this happens now when I try to preview a directory full of images from one of my surveillance cameras, of about 2900 in this case.

looks like something is using too many files.  I'm going to try rebooting and not starting everything and see what happens.

this message comes out of the console log in my case.

here is a google group discussion with a message with some sysctl command suggestions.

https://groups.google.com/forum/#!topic/uk.comp.sys.mac/Qw7QxZGXGak

> Third time now. Machine hasn't been touched in almost a week, I come
> back and find it has hung - hard power off, then after reboot i find
> the kernel log full of 'file table is full'.
>
> Any ideas how to go about tracing this?
This limit is controllable using sysctl. To see the current values:
sysctl kern.maxfiles kern.maxfilesperproc
Mine says 12288 and 10240. OS X *used* to read in definitions when it
booted from /etc/sysctl.conf, but you can change those values on the
fly.
Why you're running out is more of a mystery. I suppose you could run
lsof regularly over a period and see what changes.

Thursday, December 26, 2013

yum notes Redhat Enterprise Linux 6.2 or such.

to find out what package contains a command using yum.  must have repository set up.

yum whatprovides vnc-server

To set up repository after installation to use dvd as source:

put this in /etc/yum.repos.d/rhel-media  (any file name will do)

[rhel-media]
name=Red Hat Enterprise Linux 6.2
baseurl=file:///mnt/cdrom/Server/

file:///mnt/cdrom/
gpgcheck=0
enabled=1
gpgkey=file://etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


The gpgkey can be left out if the gpg checking is off (as shown)  noted only if you want to mess with such.  for media it isn't much use if you know where your media came from.

yum will find and install any package on the dvd.  Create another file in the repos directory for any additional media.  This example uses the 6.2 install media dvd 1 as an example.

Gui application install front end for system, also invoked by system->administration->add/remove software with gnome desktop

 gpk-application

run from a gnome command window at user level command line (not root).

Jay's 3174 setup instructions

Re: 3174 ( and Jay's parms)

Last year, Jay sent me these customization parms which worked well
for me. (Thanks again, Jay) I found that the 3278, 3178, 3191 (from
heaviest to lightest) work the best. The 3279 seems to work okay but
as I indicated previously, graphics support is disabled.
Dave S.
(Following from Jay)-------------------------------------
Here you go:

This configuration is defined to use 2 physical terminals with 5
logical
terminal sessions each. There is no SNA host on my network, so SNA
parameters are only specified enough to keep the customization
procedure
happy. My controller does not have AEA hardware, so it's disabled and
no
customization is done for it. Questions not specified here are
allowed to
default.

Main menu option 1, customization:

Model/Attach:

098 FOO (online test password)
099 whatever (product assistance data)
100 63R (controller model)
101 7 (host attach via Token Ring)
102 1 (LAN adapter type)

Token-Ring Description:

080 4000 C0A8 4902 (address; 40000 + hex value of IP address)
082 1 (16 MBPS ring speed, with no early release)

LAN:

106 4000 C0A8 4902 04 (address and SAP)
107 4000 C0A8 4901 04 (gateway address and SAP; dummy value)
108 23V4504 (my machine S/N)
110 2 0000 (MLT configuration: allow controller to assign addresses)
116 1_ __ (MLT addressing)

Common SNA:

all defaults

117 - Port Assignment:

Enter 5 for IS for first two ports (26-00 and 26-01), and any others
you
intend to use.

Frame Relay Description:

300 0 (disable frame relay)

End-User Productivity Functions:

001 0000 (Local Copy print queue buffer size)
002 1 (calculator function - RPN)
003 0 (5250 emulation off)
004 5 (LAN T1 timer)
005 07 (LAN retry count)
006 N (copy from session to session)
007 N (HAP sharing for local copy)
008 Y (CSCF IML passwor drequired)
009 all 0s (nonstandard options)

Save your responses.

Main menu option 5, AEA/TCP/IP configuration:

AEA and TCP/IP Configure:

700 0 1 (disable AEA, enable TCP/IP)

Port set:

1 Name 3270DISP, session limit 5, port type 1

Port to Port Set Map:

Enter 1 in ports 26-00 and 26-01. (And any others you intend to use.)

There will be 4 AEA and TCP/IP station sets.

Set 1:
721 UNUSED SNA (station set name)
722 3H (station type: 3270 host)

Set 2:
721 TELNET (station set name)
722 TH (telnet host)
751 4 (emulate VT220 with 7-bit controls)
763 0 (new line option: don't assume LF with CR)

Set 3:
721 TN3270 (station set name)
722 TH (telnet host)
751 6 (TN3270)

Set 4:
721 3270 DISPLAYS (station set name)
722 3D (station type: 3270 display)
723 3270DISP (port set name)

AEA and TCP/IP Default Destination:

Leave all entries blank. This will force all logical terminals to the
connection menu.

TCP/IP Options Menu:

052 192.168.073.002 (3174 IP address; change as needed for your LAN)
054 255.255.255.000 (IP subnet mask; change as needed)
057 N (3174 will not do IP routing)
058 010 (maximum telnet sessions; set to 5*number of devices)
059 00 (maximum printer connections)
060 0020 (TCP/IP buffer space, in KB; adjust as needed once you see
how much
memory is actually used)
062 Y (routing field support)
064 Y (all routes broadcast)

TCP/IP Routing Information:

Enter one route, no destination IP address, type D (default), router
IP
address 192.168.073.001 (or whatever your default gateway is).

TCP/IP Domain Name Services: (Change these as needed.)

Controller Hostname: MRSQUEAK
Controller Domain Name: CONMICRO CX (note the space instead of dot)
Domain Nameserver IP Addresses: 192.083.120.001

TCP/IP Controller Defined Nicknames:

Leave blank. (Unless you want to define the equivalent of /etc/hosts.)

Save responses. You're done.

Wednesday, December 25, 2013

Grabbing X11 display into an mpg file (example from ffmpeg man pages Ubuntu)

I didn't know this had been integrated or that there was a method for ffmpeg input to be the x display.

EXAMPLES

   Video and Audio grabbing
       If you specify the input format and device then ffmpeg can grab video and audio directly.

               ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg

       Note that you must activate the right video source and channel before launching ffmpeg with any TV viewer such as
        xawtv ("http://linux.bytesex.org/xawtv/") by Gerd Knorr. You also have to set the audio recording levels correctly with a standard mixer.

   X11 grabbing
       Grab the X11 display with ffmpeg via

               ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg

       0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable.

               ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg

       10 is the x-offset and 20 the y-offset for the grabbing.

               ffmpeg -f x11grab -follow_mouse centered -s cif -r 25 -i :0.0 /tmp/out.mpg

       The grabbing region follows the mouse pointer, which stays at the center of region.

               ffmpeg -f x11grab -follow_mouse 100 -s cif -r 25 -i :0.0 /tmp/out.mpg

       Only follows when mouse pointer reaches within 100 pixels to the edge of region.

               ffmpeg -f x11grab -show_region 1 -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg

       The grabbing region will be indicated on screen.

               ffmpeg -f x11grab -follow_mouse centered -show_region 1 -s cif -r 25 -i :0.0 /tmp/out.mpg

       The grabbing region indication will follow the mouse pointer.

Grabbing input from other devices:

http://ffmpeg.org/ffmpeg.html

Video and Audio grabbing

If you specify the input format and device then ffmpeg can grab video and audio directly.
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
Or with an ALSA audio source (mono input, card id 1) instead of OSS:
ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
Note that you must activate the right video source and channel before launching ffmpeg with any TV viewer such as xawtv by Gerd Knorr. You also have to set the audio recording levels correctly with a standard mixer.

Changing out soundtrack with ffmpeg. Example of moving ogg soundtrack to matroska (mkv)

Matroska file format (mkv) is specified with -f matroskaoption. It should be supported by ffmpeg (version 0.7.3) in Ubuntu 11.10.

Use ffmpeg -formats for a list of supported file formats.

To merge specific streams (audio or video) from several files use -i option for each input and -map input_index[:stream_index]. For example, the following command merges the first stream of the first input with the second input and keeps the codecs:
 
ffmpeg -i input.mkv -i input_audio.ogg -map 0:0 -map 1 -vcodec copy -acodec copy output.mkv


http://ffmpeg.gusari.org/viewtopic.php?f=25&t=611
 
ubuntu video conversion
 
http://ubuntuguide.org/wiki/Video_Conversion#FFMPEG
 

Monday, December 9, 2013

disabling warnings in MS VS

Used to have to do this, this posting shows how to do a bad practice.  It does however have an example of how to disable warnings in c++ on VS.

// document here exactly why you can not use strncpy_s
#pragma warning( push )
#pragma warning( disable : 4996 )
// your code that uses strncpy instead of strncpy_s
#pragma warning( pop ) 
 
how-to-achieve-strncpy-functionality-with-strncpy-s-function