Tv-star.sh, a little script for managing tv.

Hi altogether!
I wanted a very small app to watch and record tv with my dvb-t stick, so I created tv-star.sh:
#!/bin/bash
# Befor you start, you need to edit the 2
# variables SCANBASE and MOVIEFOLDER
# This is the base-file for the frequency-scan.
# Chose the one corresponding to your location.
SCANBASE="/usr/share/dvb/dvb-t/de-Schleswig-Holstein"
# Folder where the movies are stored.
# IMPORTANT: Use the full path, don't use ~ for your home!
# Example:
# MOVIEFOLDER="/home/tux/tv/"
MOVIEFOLDER=""
echo -e "\n***********************************"
echo "*** tv-star 0.5 ***"
echo "*** by Thomas Schuetz ***"
echo "***********************************"
MAINLOOP=1
if [ "$MOVIEFOLDER" == "" ]; then
MAINLOOP=0
echo -e "\nYou need to edit the variables SCANBASE and MOVIEFOLDER in the top of the script before you can use it.\n"
fi
while [ ${MAINLOOP} -gt 0 ]; do
echo -e "\n"
echo "1) Watch TV"
echo "2) Record a movie"
echo "3) Cancel the record of a movie"
echo "4) Watch recorded movie"
echo "5) Delete recorded movie"
echo "8) Show informationen about tv-star.sh"
echo "9) Create new channel.conf"
echo "0) Quit"
echo -e -n "\nYour choice: "
read INPUT
echo -e "\n"
case $INPUT in
1) echo "Please chose the station you want to watch:"
NUMBER=0
for LINE in `cat ~/.mplayer/channels.conf | sed s/:.*//`; do
NUMBER=$((NUMBER+1))
echo -n ${NUMBER}") "
echo ${LINE};
done
echo -e -n "\nYour choice: "
read STATION
STATIONNAME=`tail -n +$STATION ~/.mplayer/channels.conf | head -n 1 | sed s/:.*//`
mplayer dvb://${STATIONNAME}
2) echo "Please chose the station where you want to record a movie:"
NUMBER=0
for LINE in `cat ~/.mplayer/channels.conf | sed s/:.*//`; do
NUMBER=$((NUMBER+1))
echo -n ${NUMBER}") "
echo ${LINE};
done
echo -e -n "\nYour choice: "
read STATION
RECORDSTATION=`tail -n +${STATION} ~/.mplayer/channels.conf | head -n 1 | sed s/:.*//`
echo -e -n "\nWhen do you want to start the record (Format: 20:15)? "
read RECORDSTART
echo -e -n "\nWhen do you want to end the record (Format: 22:00)? "
read RECORDEND
echo -e -n "\nHow should the file be named? "
read RECORDFILE
echo "mplayer -quiet dvb://${RECORDSTATION} -dumpstream -dumpfile ${MOVIEFOLDER}${RECORDFILE}" | at ${RECORDSTART}
echo "killall mplayer" | at ${RECORDEND}
echo
3) echo "Available at-jobs:"
atq
echo "I will always cancel the start- and the end-job, please only enter the number of the start-job (the one with the lower number)!"
echo -e -n "\nWhich job do you want to cancel (0 = none): "
read JOB
if [ ${JOB} -gt 0 ]; then
atrm ${JOB}
KILLJOB=$((${JOB}+1))
atrm ${KILLJOB}
fi
4) echo "Recorded movies:"
NUMBER=0
for LINE in `ls ${MOVIEFOLDER}`; do
NUMBER=$((NUMBER+1))
echo -n ${NUMBER}") "
echo ${LINE};
done
echo -e -n "\nWhich movie do you want to watch (0 = none): "
read MOVIEFOLDERNUMBER
NUMBER=0
if [ ${MOVIEFOLDERNUMBER} -gt 0 ]; then
for LINE in `ls ${MOVIEFOLDER}`; do
NUMBER=$((NUMBER+1))
if [ $((NUMBER)) == $((MOVIEFOLDERNUMBER)) ]; then
MOVIEFOLDERNAME=${LINE}
fi
done
mplayer ${MOVIEFOLDER}${MOVIEFOLDERNAME}
fi
5) echo "Recorded movies:"
NUMBER=0
for LINE in `ls ${MOVIEFOLDER}`; do
NUMBER=$((NUMBER+1))
echo -n ${NUMBER}") "
echo ${LINE};
done
echo -e -n "\nWhich movie do you want to delet (0 = none): "
read MOVIEFOLDERNUMBER
NUMBER=0
if [ ${MOVIEFOLDERNUMBER} -gt 0 ]; then
for LINE in `ls ${MOVIEFOLDER}`; do
NUMBER=$((NUMBER+1))
if [ $((NUMBER)) == $((MOVIEFOLDERNUMBER)) ]; then
MOVIEFOLDERNAME=${LINE}
fi
done
rm -i ${MOVIEFOLDER}${MOVIEFOLDERNAME}
fi
8) echo "About tv-star.sh 0.5 by Thomas Schuetz, 2011-08-27:"
echo "---------------------------------------------------"
echo -n "There are great mediacenter-projects like MythTV, but they are too big for "
echo -n "my simple needs. In fact, you only need one single line to record a movie, "
echo -n "but I was too lazy to type the long line always by myself, so I created this "
echo "little script and put everything in it, I need for handling tv."
echo -n "The script itself is very simple, it only needs mplayer, the scan-command "
echo -n "from the dvb-apps and some standard shell-commands. Before you really use it, "
echo "you need to edit the variables SCANBASE and MOVIEFOLDER in the top of the script."
9) echo -e "Creating a new channel.conf, please wait a while!\n"
rm -f ~/.mplayer/channels.conf.old
mv ~/.mplayer/channels.conf ~/.mplayer/channels.conf.old
scan $SCANBASE | sed -e 's/\ /_/g' -e 's/\//_/g' -e 's/\*//' > ~/.mplayer/channels.conf
0) echo -e "Thank you for using tv-star.sh!\n"
MAINLOOP=0
*) echo -e "Wrong input, please chose again!\n"
esac
done
I am no programmer, so if you have any ideas how I can make the script better, please tell me!

Some improvements:
diff --git a/tv-star.sh b/tv-star.sh
index a9b6666..3bfe603 100644
--- a/tv-star.sh
+++ b/tv-star.sh
@@ -8,25 +8,16 @@
SCANBASE="/usr/share/dvb/dvb-t/de-Schleswig-Holstein"
# Folder where the movies are stored.
-# IMPORTANT: Use the full path, don't use ~ for your home!
-# Example:
-# MOVIEFOLDER="/home/tux/tv/"
-MOVIEFOLDER=""
+MOVIEFOLDER=~/tv/
+mkdir -p $MOVIEFOLDER
-echo -e "\n***********************************"
+echo
+echo "***********************************"
echo "*** tv-star 0.5 ***"
echo "*** by Thomas Schuetz ***"
echo "***********************************"
-MAINLOOP=1
-if [ "$MOVIEFOLDER" == "" ]; then
- MAINLOOP=0
- echo -e "\nYou need to edit the variables SCANBASE and MOVIEFOLDER in the top of the script before you can use it.\n"
-fi
-while [ ${MAINLOOP} -gt 0 ]; do
+while :; do
echo -e "\n"
echo "1) Watch TV"
echo "2) Record a movie"
@@ -40,7 +31,7 @@ while [ ${MAINLOOP} -gt 0 ]; do
read INPUT
echo -e "\n"
case $INPUT in
- 1) echo "Please chose the station you want to watch:"
+ 1) echo "Please choose the station you want to watch:"
NUMBER=0
for LINE in `cat ~/.mplayer/channels.conf | sed s/:.*//`; do
NUMBER=$((NUMBER+1))
@@ -139,9 +130,9 @@ while [ ${MAINLOOP} -gt 0 ]; do
scan $SCANBASE | sed -e 's/\ /_/g' -e 's/\//_/g' -e 's/\*//' > ~/.mplayer/channels.conf
0) echo -e "Thank you for using tv-star.sh!\n"
- MAINLOOP=0
+ break
*) echo -e "Wrong input, please chose again!\n"
esac
Last edited by JohannesSM64 (2011-08-27 08:30:45)

Similar Messages

  • Disaster Recovery Scripts for Managed Server MSI Startup

    I am trying to get some custom start scripts created for each of my managed servers in the event the admin console is down or server gets hosed. We use nodemanager to start the managed servers in a Windows environment. I have about 8 managed servers and they all use the same nodemanager classpath but all have different server start arguments (different memory settings, etc....) so I need to make different custom scripts for each.
    Verbose Garbage Collection to Determine Heap Size .....this thread by Jay has been very helpful but so far I am just getting kicked back to the syntax screen like something is wrong in my script. Attached is the script and the output when I run it. Any help would be appreciated...thanks.
    startManagedFPCE1.cmd contents
    java.exe -Xms400m -Xmx400m -classpath $CLASSPATH -Dweblogic.Name=FPCE1 -Dbea.home="C:\Oracle\Middleware" -Dweblogic.management.username=beaadmin -Dweblogic.management.password=beaadminxxx -Dweblogic.management.server=http://sitportal1:8098 -Djava.library.path=c:\Oracle\Middleware\wlserver_10.3\server\bin -Dweblogic.ext.dirs=C:\Oracle\Middleware\patch_wls1032\profiles\default\sysext_manifest_classpath;C:\Oracle\Middleware\patch_wlp1032\profiles\default\sysext_manifest_classpath;C:\Oracle\Middleware\patch_oepe1111\profiles\default\sysext_manifest_classpath;C:\Oracle\Middleware\wlportal_10.3\p13n\lib\system;C:\Oracle\Middleware\wlportal_10.3\light-portal\lib\system;C:\Oracle\Middleware\wlportal_10.3\portal\lib\system;C:\Oracle\Middleware\wlportal_10.3\info-mgmt\lib\system;C:\Oracle\Middleware\wlportal_10.3\analytics\lib\system;C:\Oracle\Middleware\wlportal_10.3\apps\lib\system;C:\Oracle\Middleware\wlportal_10.3\info-mgmt\deprecated\lib\system;C:\Oracle\Middleware\wlportal_10.3\content-mgmt\lib\system -Dweblogic.alternateTypesDirectory=C:\Oracle\Middleware\wlportal_10.3\portal\lib\security
    Results of running above script:
    C:\Oracle\Middleware\user_projects\domains\SIT11\servers\FPCE1>java.exe -Xms400m -Xmx400m -classpath $CLASSPATH -Dweblogic.Name=FPCE1 -Dbea.home="C:\Oracle\Middleware" -Dweblogic.management.username=b
    eaadmin -Dweblogic.management.password=beaadminsit11 -Dweblogic.management.server=http://sitportal1:8098 -Djava.library.path=c:\Oracle\Middleware\wlserver_10.3\server\bin -Dweblogic.ext.dirs=C:\Oracle
    \Middleware\patch_wls1032\profiles\default\sysext_manifest_classpath;C:\Oracle\Middleware\patch_wlp1032\profiles\default\sysext_manifest_classpath;C:\Oracle\Middleware\patch_oepe1111\profiles\default\
    sysext_manifest_classpath;C:\Oracle\Middleware\wlportal_10.3\p13n\lib\system;C:\Oracle\Middleware\wlportal_10.3\light-portal\lib\system;C:\Oracle\Middleware\wlportal_10.3\portal\lib\system;C:\Oracle\M
    iddleware\wlportal_10.3\info-mgmt\lib\system;C:\Oracle\Middleware\wlportal_10.3\analytics\lib\system;C:\Oracle\Middleware\wlportal_10.3\apps\lib\system;C:\Oracle\Middleware\wlportal_10.3\info-mgmt\dep
    recated\lib\system;C:\Oracle\Middleware\wlportal_10.3\content-mgmt\lib\system -Dweblogic.alternateTypesDirectory=C:\Oracle\Middleware\wlportal_10.3\portal\lib\security
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    where options include:
    -server to select the "server" VM
    -hotspot is a synonym for the "server" VM [deprecated]
    The default VM is server.
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options

    "bharat nagwani" <[email protected]> wrote:
    >
    Hi,
    Configuration: Weblogic 8.1SP2 on Windows 2000, 1 admin server and 14
    managed
    servers
    whats the right way from these 2 scenarious to create a domain on managed
    server
    1. create domain on managed server using configuration wizard. Then point
    to this
    domain from administration server remote start tab(root directory). This
    is what
    we do so far.This is the best way to create managed servers for your domain.
    >
    2. Just enter user_projects/domains folder/$domain name$ in remote start
    tab(root
    directory)
    on admin server console and when you start the managed server from
    admin console
    the domain folder and files will be created.
    Yes, the managed server is started in this case at the root directory you specified.
    The difference is in the
    1. first case we see all scripts like startManagedWeblogic, setenv, boot.properties
    etc
    this may help(we still dont know) if one wants to bring up managed
    server
    manually using
    startManagedServer.bat without using node manager.Yes, that is correct. You will need to edit the startManagedServer.bat to include
    the admin server URL, username and paswword..
    >
    2. second case only 2-3 files get created like msi-config.xml and SerializedSystemIni.dat
    Basically first case is superset of second case.
    What is the experience of people in this regard?
    thanks much
    bharat

  • Handy dandy little script for counting frames

    I have this little jsfl script which came from one of the
    contributors to
    this NG, works a treat for telling me exactly how many frames
    I have
    selected at a time, heavensent for "paste frames", a wonder
    why Adobe never
    incorporated such a thing into the interface.
    Anyway it worked fine in Flash 8 - I just dropped it into
    "\en\First
    Run\Commands" folder and up it pops in my Command Menu. It
    doesn't happen in
    CS3 though. It still works if I launch it manually while
    running Flash, but
    they must have done something to the DOM that prevents it
    from showing in
    the menu.
    Can anybody help me out with that? Here is the script:
    var current_tl = fl.getDocumentDOM().getTimeline();
    var selectedFrames = current_tl.getSelectedFrames();
    var selectedRegions = selectedFrames.length/3;
    fl.outputPanel.clear();
    fl.trace('Selected Regions: '+selectedRegions);
    var count = 0;
    while(selectedFrames.length){
    count++;
    var region = selectedFrames.splice(0,3);
    fl.trace(' -Region '+count+':');
    fl.trace(' First Frame: '+(region[1]+1));
    fl.trace(' Last Frame: '+(region[2]));
    fl.trace(' Selection Span: '+(region[2]-region[1]));

    Ok - I just figured it out. It all goes in Local Settings:
    \Local
    Settings\Application Data\Adobe\Flash
    CS3\en\Configuration\Commands
    "Stephen C" <[email protected]>
    wrote in message
    news:f20vpb$fv3$[email protected]..
    >I have this little jsfl script which came from one of the
    contributors to
    >this NG, works a treat for telling me exactly how many
    frames I have
    >selected at a time, heavensent for "paste frames", a
    wonder why Adobe never
    >incorporated such a thing into the interface.
    >
    > Anyway it worked fine in Flash 8 - I just dropped it
    into "\en\First
    > Run\Commands" folder and up it pops in my Command Menu.
    It doesn't happen
    > in CS3 though. It still works if I launch it manually
    while running Flash,
    > but they must have done something to the DOM that
    prevents it from showing
    > in the menu.
    >
    > Can anybody help me out with that? Here is the script:
    >
    > var current_tl = fl.getDocumentDOM().getTimeline();
    > var selectedFrames = current_tl.getSelectedFrames();
    > var selectedRegions = selectedFrames.length/3;
    > fl.outputPanel.clear();
    > fl.trace('Selected Regions: '+selectedRegions);
    > var count = 0;
    > while(selectedFrames.length){
    > count++;
    > var region = selectedFrames.splice(0,3);
    > fl.trace(' -Region '+count+':');
    > fl.trace(' First Frame: '+(region[1]+1));
    > fl.trace(' Last Frame: '+(region[2]));
    > fl.trace(' Selection Span: '+(region[2]-region[1]));
    > }
    >
    >

  • Little script for less AAARGH

    I wanted to advertise a small script (it's from debian - hey, don't stop reading here!) that might save you an AAAARGH one day It asks for the hostname if you invoke any shutdown/reboot command via ssh, for when you might be a bit sleepy.
    http://aur.archlinux.org:80/packages.php?ID=24349

    fukawi2 wrote:I thought WIN... That's perfect... Then I decided to test it on my live server... Perhaps this should go in to the Stupidest Computing Mistakes thread
    Read the install notice

  • Pkgman - a bash script for local package and PKGBUILD management

    hi all,
    here is a script which manages a local repository and lets you edit
    PKGBUILDs and other related files, automatically generates checksums,
    build packages, add them to your local repo and so on.
    it also has AUR support for submitting tarballs, leaving comments, etc.
    get it from here:
    http://sourceforge.net/projects/pkgman/
    and AUR package:
    http://aur.archlinux.org/packages.php?ID=17100
    you need abs, curl and pacman and optionally namcap and desktop-file-utils.
    RTFM online:
    http://sourceforge.net/apps/mediawiki/p … n_man_page
    first of all copy the pkgman.conf and AUR.conf files from /usr/share/pkgman to ~/.config/pkgman/  or ${XDG_CONFIG_HOME}/pkgman - if ${XDG_CONFIG_HOME} is set,
    edit these two files and then run
    pkgman --runmefirst
    pkgman doesn´t install anything. if you want it just builds the package and moves it to your local repository. install it then with pacman.
    it also has no dependency handling. there are many other tools which provide this.
    the main intention was to keep track of package versions, different PKGBUILD versions and own AUR submitted tarballs; also to keep a clean local repository and clean build directories.
    pkgman is stable now. i´m using it for months without any issues.
    however, if there are problems or feedback please post them here.
    vlad
    changelog:
    version 2.4:
           *pkgman now respects the PKGDEST and SRCDEST variables from makepkg.conf. (though it still moves the src.tar.gz and .pkg.tar.gz to package backup directory).
    version 2.5:
           *pkgman uses PKGDEST if SRCDEST not set in makepkg.conf.
    version 2.6 -> r26:
           *changed version system: version 2.6 is now r26!
           *minor changes: > pkgman uses now the $SHELL variable.
                                    > new and more comprehensible manpage description (thanks to bender02)
    version r27:
           *changed SRCDEST since it's only a cache dir. all files (pkg.tar.gz and src.tar.gz) go to PKGDEST.
    version r28:
           *added new variable ShellCommand to pkgman.conf. Default is $SHELL.
           *One might use an external application (like screen or xterm) to switch to build directory and edit files simultaneously.
    version r30:
           *minor changes. nothing crucial
    r32: *OverwriteExistingPackage isn't used anymore. one can delete it from ~/.config/pkgman/pkgman.conf.
           *minor changes
    version r33:
           *"-l|--list" also shows installed package version and available ABS/AUR PKGBUILD version for given package.
           *"-a|--abs" can now also be used with other options (like "-e")
    r39: * when backing up src.tarballs it asks whether to backup the source file or not
           * more detailed "--list" option - also shows if package is installed or not and available ABS/AUR version
           * added prompt to clean up directory after makepkg
           * when checking pkg.tar.gz also possibility to check for conflicts with files of already installed packages
           * use $PAGER instead of less
           * --help directly shows the manpage
           * --shorthelp shows a brief usage overview
           * added a custom prompt, but only when using bash (is somehow experimental - works fine here for me)
           * minor internal changes
           * pkgman also reads ~/.aurvote file for getting aur name and password. if one already uses aurvote then there is no need for the
             ~/.config/pkgman/AUR.conf file.
    r40: * new manual page & rewrite of usage function
           * both option "--flush" and "--flushall" were omitted in favor of the more versatile "--cleanup" option
           * pkgman <packagename> checks now if <packagename> is owned by user
           * backup option after each editing
           * added license
           * minor internal changes
    r41: * just small bug fixes, nothing crucial.
    r42: * more bugs fixed.
    r45: * new options added:
              >   --listversions: list local and available versions of installed packages from LocalPackages directory
              >  --getownpackages: synchronize local own packages with AUR
           * added new variable in pkgman.conf:
              > ListOutputInPager: output of, for example, "--list" or "--own" is piped into $PAGER
           * added a new optional dependency "desktop-file-utils" for validating desktop entry files
           * also supports now auto-generation of sha sums not only md5
           * internal fixes due to AUR interface changes:
              > use of json interface
              > correct parsing of package category
           * added 2 proto files (located under /usr/share/pacman):
              >  proto.desktop: a template for *.desktop files
              > PKGBUILD-lib32.proto: a template for lib32 packages for x86_64
           * some code changes and fixes
    r46: * added new option to pkgman.conf (AutoGenerateSums).
             > if AutoGenerateSums=no then pkgman asks whether to generate checksums or not.
             > if set to yes it behaves like in former versions.
    r52: * "--getownpackages" with more than 100 packages works again
           * added new option "--cachecopy":
              For each package in CacheCopyList (new variable in pkgman.conf) get existing package from pacman's cache directory - if
              CopyPkgFromCache (new variable in pkgman.conf) is set to yes - and/or create a source tarball of PKGBUILD and related files from ABS -
              if CopySrcFromABS (new variable in pkgman.conf) is set to yes - and copy them to package backup directory.
           * added new variables to pkgman.conf:
               > "CacheCopyList=file" - batch backup file, one package per line - default location is "$HOME/.config/pkgman/package.list".
               > "CopySrcFromABS=[yes|no]"
               > "CopyPkgFromCache=[yes|no]"
           * some bugfixes
           * docs completed
           * CacheCopyList should look like
    package1
    package2
    #this is a comment
    ! this too
    package3
    !package4
    r54: * renamed "--listversions" option to "--diffversions". makes more sense!
              from the man page:
                  pkgman --diffversions
                  Show differing ABS/AUR versions of installed packages from LocalPackages.
    r55: * minor changes.
    r57: * testing release
           * added a new option "--rollback":
               "pkgman <packagename> --rollback" - checks  http://arm.kh.nu for available package versions,
                                                          lets you choose one, fetches the package and
                                                          moves it to the <packagename> backup directory (if "--repoadd" is used).
    r59: * stable release
           * new option "--rollback" (see r57):
                   it checks http://arm.kh.nu (Arch Rollback Machine) for available package versions,
                   downloads chosen file and moves it to local repository (if "-r|--repoadd"  is used).
            * posting files/comments/etc to AUR should work now again.
    r65: *stable release
           * new option "-M,--meta" to create metapackages and add them and their dependencies to local repository.
              it searches for deps inside the backup directories, pacman's cache and if the packages are not available, it tries to fetch the missing
              dependencies from the Arch Rollback Machine site (http://arm.kh.nu).
    r66: * minor fixes
    r68: * some bugfixes
           * "--repoadd" and "--Reporemove" now accurately removes old packages from LocalRepository
    r69: * small bugfixes when listing packages with similar names
           * curl retries now 5 times if connection is not established
    r75: * "--cachecopy" does not try to dl sourcefiles when backing up ABS PKGBUILDs
           * some work on package splitting
           * further internal changes
    r76: * minor mistakes with "ln" purged
    r79: * mostly small changes
           * "--cleanup" now also removes uninstalled packages from LocalRepository
    r81 & r80: * added AUR v1.6.0 support (use more json)
                    * small ARM changes ("--rollback")
    r85:
          * pkgman supports pkg.tar.xz packages
          * some code rewrite, bugs purged (hopefully)
    r113:
          * pkgman now supports building split packages through makepkg.
             If you already use pkgman you need to rerun "pkgman --runmefirst" after updating.
          * new  "-t,--template" option ("pkgman <packagename> --template <alt. packagename> [--pkgbuildversion <version>] [options]").
             Useful to create a new PKGBUILD and use an existing one as a template.
          * new option: "--conf /path/to/alternate/conf/file" - Specify another configuration file.
          * pkgman now uses ${XDG_CONFIG_HOME}/pkgman or $HOME/.config/pkgman - if first not set - as the default location for its conf files.
    r116:
          * check inet conection when submitting src tarballs to AUR
          * some bugs
          * updated manpage on sf
    For further details please read the manual page.
    Last edited by DonVla (2010-04-28 11:56:59)

    I'm having some troubles with it (perhaps missing dependencies, and forgotten hardcoded dirs?):
    jan@aconcagua 8:20PM ~ % pkgman --runmefirst
    /usr/bin/pkgman: line 77: /home/jan/apps/skripte/archscripts/pkgman/share/pkgman/color.bash: No such file or directory
    /usr/bin/pkgman: line 1293: initcolor: command not found
    /usr/bin/pkgman: line 312: highlight: command not found
    /usr/bin/pkgman: line 312: error: command not found
    /usr/bin/pkgman: line 313: highlight: command not found
    /usr/bin/pkgman: line 313: error: command not found
    /usr/bin/pkgman: line 314: highlight: command not found
    /usr/bin/pkgman: line 314: error: command not found
    /usr/bin/pkgman: line 315: highlight: command not found
    /usr/bin/pkgman: line 315: error: command not found
    /usr/bin/pkgman: line 317: error: command not found
    /usr/bin/pkgman: line 318: error: command not found
    /usr/bin/pkgman: line 321: highlight: command not found
    /usr/bin/pkgman: line 321: msg: command not found
    /usr/bin/pkgman: line 329: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    touch: cannot touch `/bin/.pkgman.registered': Permission denied
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 332: list: command not found
    /usr/bin/pkgman: line 337: msg: command not found
    curl: option --output: requires parameter
    curl: try 'curl --help' or 'curl --manual' for more information
    ^C/usr/bin/pkgman: line 209: cleanoutput: command not found
    /usr/bin/pkgman: line 209: cleanoutput: command not found
    (I terminated with ctrl-c).
    EDIT: errors resolved by correcting the path $HOME/apps/skripte/archscripts/pkgman/share/pkgman to /usr/share/pkgman in the pkgman itself.
    Last edited by bender02 (2008-05-23 01:28:58)

  • Scripts for starting/stopping managed servers

    All,
    Could someone provide me with some sample scripts for starting/stopping managed Weblogic servers?  I'm specifically looking for ways to start/stop them WITHOUT starting the AdminServer.  I'm running WLS 10.3.6 on Windows Server 2003, and I have NodeManager set to start automatically as a Windows service.
    I know how to set my managed servers up as Windows services so that they will start automatically at boot, but this requires the AdminServer to be running, which I do not want.  I just want a few scripts for starting/stopping the managed servers (and maybe some hints as to how to make them start automatically without starting the AdminServer).
    Thanks in advance,
    Tom

    Hello Puneet,
    Admin console is an web application deployed into AdminServer. Hence if you shutdown AdminServer then you wouldn't able to access Admin console.
    Managed Server would function in MSI mode, however you will not be able to make any configuration or administration activities like deployment , any configuration changes , etc.
    Hello PRISM,
    Can you confirm your requirement about why you don't want AdminServer to be running?
    As I said,  you will loose the administration capability if you don't have admin server running.
    Regards
    Rosario

  • Powershell script for Use this termset for site navigation in tem store management tool in central admin

    can anyone pls point out whats the power shell script for "use this  termset for site navigation" in the termstore management tool in my central  admin';s manage serv appln-->managed metadata serv appln ->term styore mgmnt tool
    i would like to check this "checked" through powershell script
    help is appreciated!

    Hi,
    To check if the term set has been set to be used for site navigation, we need to check the
    NavigationTermSet.IsNavigationTermSet property for the term set.
    Here is the code example for using PowerShell to get the setting:
    $site=Get-SPSite "your site collection URL";
    $session = Get-SPTaxonomySession -Site "your site collection URL ";
    $termStore = $session.TermStores["Managed Metadata Service"];
    $Group = $termStore.Groups[“Group Name”];
    $TermSet = $Group.TermSets[“Term Set Name”];
    $navTermSet = [Microsoft.SharePoint.Publishing.Navigation.NavigationTermSet]::GetAsResolvedByWeb($termset, $site.RootWeb, "GlobalNavigationTaxonomyProvider");
    write-host $navTermSet.IsNavigationTermSet
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Open module for managing property file and environment variables

    Looking for an open module for managing property files and environment variables (like CLASSPATH) set in a shell script. For handeling properties (preserving comments, supporting includes, appending new entries, and more) I have looked at SuperProperties from openadaptor but find certain functionality lacking. As for interfacing with common shell scripts/files containing setting for CLASSPATH, JAVA_HOME, other system/application variables another type of object editor is needed. Maybe JFIG?
    Any ideas are greatly welcomed.

    You seem wright, you hit a brick wall here with Air to find the location
    of the command console on windows...
    So in fact I never build an exe tool, but this little problem was a nice
    case to test it and I tried it.:
    I downloaded monodevelop
    -GTK# for .NET 2.12.10*
    -MonoDevelop 2.4.2*
       from http://monodevelop.com/Download
    created a console project and had an exe in 5 minutes !
    You can download the findconsole tool and the projectfiles here:
       http://greencollective.nl/temp/dump/findconsole_monoproject.zip
    findconsole.exe will reveal the path/location of cmd.exe on a windows system.
    Cheers,
    Latcho

  • Paperq: a tool for managing a reading queue of academic literature

    paperq is a command-line tool for managing a reading queue of academic literature.   It's usage is simple: you add files to the queue and then you run it without arguments to open the next file in the queue. The queue part of the code itself is rather simple but paperq also offers some other nice features:
    Add files (-a option)
    Remove a file (-r option)
    Display info on a file. Given a BibTeX file,  print the bibliographic information, otherwise print the file location (-i option)
    List all files (or bibliographic information) in the queue (-l option)
    Create an archive (tar.gz) of the papers in the queue, prepending the file names with the queue position (-z option)
    Operate on any file in the queue, instead of the head, via the -n option
    Peek at a file (open it, but don't remove it from the queue) via the -p option
    Print a file (-t option)
    Configurable file-opening command (xdg-open %s, by default)
    Documentation is available in the README file or on the website (see below). A man page is also included.
    I've been using it myself now that I finally stopped using Mendeley. I find it to be quite handy, so I've packaged it up to be shared with others.
    Screenshot showing the bibliographic info:
    Website
    AUR
    Last edited by jakobcreutzfeldt (2014-01-28 09:15:50)

    I just uploaded version 1.1.1.  I somehow missed a bug in which the first word of the author list was being chopped off. It's fixed.
    marttt wrote:Thanks very much for this! I can finally ditch some of my ugly scripts now. Have you considered adding other bibliographic data formats in the future? (Here is an interesting solution with YAML and Pandoc and, correspondingly, proper UTF-8 support.)
    Glad to hear it could be of use to you! Honestly, this also just started out as a quick script but little by little I started adding more handy features.
    As for other bibliographic formats, it could be possible. I'm mainly familiar with BibTeX, so I would need to see how the other formats look. 
    In all honesty, the bibliographic info printing could be greatly expanded: only journal articles are supported at the moment, and mathematical expressions in the titles aren't yet supported (i.e. greek characters).  It might be more efficient in the long run to write a dedicated biblio parsing program that loads some pre-written BibTeX-parsing library rather than all the crazy sed work that's going on in there right now. If that's the case, then it's just a  matter of loading some library for a different biblio file format in order to support it.

  • WLST Script for Disabling/Enabling Global SLA Alerting.

    Hello,
    I wanna find a way from the WLST to disable and enable the SLA Alerting which is under Operations-->Global Settings in the sbconsole. This is the global setting not per sercive!
    I have found how to create a session and how to disable the alerts per service, but i cannot find which MBean is accessed when throught the sbconsole the global SLA alerting is disabled/enabled.
    Can anybody point me to the right direction or help me to find how to do this from WLST.
    Thanks.

    Hi Ganesh,
    I have finally created the script i was looking for.. I copy-paste it below as a sample... For sure you need all the lines of code until the comment i have put "#####you need this code above"
    now the code you see below the comment is for disabling the global sla alerting... you have to write a bit to target a specific service that you want to disable.
    Keep in mind that after you make your change you hava to include those lines in order to activate the changes and disconnect and exit..
    sessionMBean.activateSession(sessionName, "enable SLA")
    disconnect()
    exit()
    If you have access to oracle support search for wlst script for osb it has a lot and you can find how to target a specific service...
    I hope that i help a little bit
    import sys
    import wlstModule
    from com.bea.wli.sb.management.configuration import SessionManagementMBean
    from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
    #from com.bea.wli.sb.management.configuration import ProxyServiceConfigurationMBean
    from com.bea.wli.sb.management.configuration.operations import OperationsConfigMBean
    from com.bea.wli.config import Ref
    from com.bea.wli.sb.util import Refs
    # Connect (username, password, URL)
    connect('weblogic', 'password', 't3://localhost:7001')
    domainRuntime()
    # Create a session name
    sessionName =sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
    print('... after session. Session is: ', sessionName)
    # Get the session MBean and create a session
    sessionMBean = findService(SessionManagementMBean.NAME,SessionManagementMBean.TYPE)
    print('-debug-this is the sessionbean',sessionMBean)
    print('SessionMBean is: ', sessionMBean)
    sessionMBean.createSession(sessionName)
    print(String('Session was created ... ').concat(sessionName))
    #####you need this code above
    domainCustom()
    cd('com.bea')
    #path='com.bea:Name=OperationsConfig.'+sessionName+',Location=AdminServer,Type=com.bea.wli.sb.management.configuration.operations.OperationsConfigMBean'
    cd('com.bea:Name=OperationsConfig.'+str(sessionName)+',Location=AdminServer,Type=com.bea.wli.sb.management.configuration.operations.OperationsConfigMBean')
    set('DomainSLAAlertingEnabled',java.lang.Boolean("true"))
    # Now commit (activate) the changes
    sessionMBean.activateSession(sessionName, "enable SLA")
    disconnect()
    exit()

  • SAP Screen Personas problem in a script for FS00(G/L Account Display) screen

    We are facing a problem when we are developing a simple script for FS00(G/L Account Display) in SAP Screen Personas. Let me give you a brief of the problem:
    We have taken two text fields in the dashboard from which the values will be copied and will be pasted in corresponding text fields of G/L Account and Company Code in FS00 TCode.
    When we are giving both the values, then script is working fine and it will navigate to the customized Personas screen where all the details are shown.
    But when we are leaving any one/both fields blank and execute the script option, then the pop to enter G/L Account/Company Code is coming:
    If we are setting the basic FS00 TCode view as default then after the pop-up we are able to enter the respective G/L account number or company code and everything is running fine.
    If we are setting our customized personas screen as default screen, then the pop-up keeps on appearing and therefore we are not able to give the inputs (G/L account or company code).
    And even if somehow manage to get rid of the error and enter the correct GL account and Company Code then also the details are not displayed. The F4 search help to pick the G/L account number and company code is not working, somehow the Personas screen seems to be locked here.
    Please let us know if someone has already encountered this type of situation before and what should be the solution of this.

    Hi,
    You could ensure that both of the text fields are not empty on your 'dashboard' before executing the FS00 tcode. This would negate the popup from ever appearing.
    To do this you can use the "IF <text field control ID> Is Empty" statement in your script and then output a custom error message to another text box if the condition is true. then use an "IF <text field control ID> Is NOT Empty" statement to copy the value/s execute the FS00 tcode if the condition is true.
    Now if you're going to check multiple fields for entries before executing the FS00 you'll have to get a little more creative and do something like I did in one my scripts (thanks again to Steve Rumsby for the tips) and create a 'check field' where you can enter values for items checked successfully and then use a little bit of javascript to count up the checks and check the result before executing the next part of the script.
    Another idea is to check for the existence of the popup and navigate past it in your script, to do this you can use the "IF <control ID> control exists" statement.
    Either one should work.

  • Error in shutdown script for bea weblogic

    We have this error in the shutdown script of our bea weblogic:
    ./stopWebLogic.sh[33]: -Xms256m: not found.
    using the Oracle OCI database driver
    Shutdown initiated
    The shutdown sequence has been initiated.the script is as follows:
    echo "using the Oracle OCI database driver"
    export ORACLE_HOME=/opt/oracle/product/8.1.7
    export NLS_LANG=AMERICAN_AMERICA.UTF8
    export ORACLE_CLIENT_VERSION=817
    export ORACLE_API_VERSION=8
    PATH=$PATH:$ORACLE_HOME/bin
    SHARED_LIBRARY_PATH=$WEBLOGIC_HOME/lib/hpux11:$WEBLOGIC_HOME/lib/hpux11/oci$ORACLE_CLIENT_VERSION\_$ORACLE_API_VERSION:$ORACLE
    _HOME/lib
    PATH=$JDK_HOME/bin:$PATH
    export PATH
    # Set application specific variables
    DOMAIN_NAME=eGovStarters
    SERVER_NAME=MyServer
    WLS_PW=weblogic
    # change to domain directory
    cd $WEBLOGIC_HOME/config/$DOMAIN_NAME
    # Allow other users in group to see created files - i.e. logfiles
    umask 027
    # Set system classpath initially to contain WebLogic product JARs
    CLASSPATH=$WEBLOGIC_HOME:$WEBLOGIC_HOME/lib/weblogic.jar
    #!/bin/sh
    # Weblogic start script for egovernment
    # Based on Colin Brick's initial version
    # Modified 02/04/03 - Colin Brick
    #       - included settings for Oblix from using SSO Assembly Test as example
    # Set General environment variables (Should normally not be changed)
    #Java settings
    JDK_HOME=/opt/bea/jdk131/
    export JDK_HOME
    JAVACMD=java
    JAVA_OPTIONS=""-server -Xms1024m -Xmx1024m -Xmn320m -XX:SurvivorRatio=8 -Xverbosegc:file=/opt/bea/wlserver6.1/config/eGovStart
    ers/logs/gc.log -Dweblogic.system.gc.enabled=false ""
    export JAVA_OPTIONS
    WEBLOGIC_PORT=51080
    #Bea settings
    BEA_HOME=/opt/bea
    export BEA_HOME
    WEBLOGIC_HOME=/opt/bea/wlserver6.1
    export WEBLOGIC_HOME
    BEA_SECURITY_POLICY=/opt/bea/wlserver6.1/lib/weblogic.policy
    export  BEA_SECURITY_POLICY
    #Oracle settings
    echo "using the Oracle OCI database driver"
    export ORACLE_HOME=/opt/oracle/product/8.1.7
    export NLS_LANG=AMERICAN_AMERICA.UTF8
    export ORACLE_CLIENT_VERSION=817
    export ORACLE_API_VERSION=8
    PATH=$PATH:$ORACLE_HOME/bin
    SHARED_LIBRARY_PATH=$WEBLOGIC_HOME/lib/hpux11:$WEBLOGIC_HOME/lib/hpux11/oci$ORACLE_CLIENT_VERSION\_$ORACLE_API_VERSION:$ORACLE
    _HOME/lib
    PATH=$JDK_HOME/bin:$PATH
    export PATH
    # Set application specific variables
    DOMAIN_NAME=eGovStarters
    SERVER_NAME=MyServer
    WLS_PW=weblogic
    # change to domain directory
    cd $WEBLOGIC_HOME/config/$DOMAIN_NAME
    # Allow other users in group to see created files - i.e. logfiles
    umask 027
    # Set system classpath initially to contain WebLogic product JARs
    CLASSPATH=$WEBLOGIC_HOME:$WEBLOGIC_HOME/lib/weblogic.jar
    domain_NAME=eGovStarters
    SERVER_NAME=MyServer
    WLS_PW=weblogic
    # change to domain directory
    cd $WEBLOGIC_HOME/config/$DOMAIN_NAME
    # Allow other users in group to see created files - i.e. logfiles
    umask 027
    # Set system classpath initially to contain WebLogic product JARs
    CLASSPATH=$WEBLOGIC_HOME:$WEBLOGIC_HOME/lib/weblogic.jar
    #Set the shared library path
    if [ -n "$SHLIB_PATH" ]; then
            SHLIB_PATH=$SHLIB_PATH:$SHARED_LIBRARY_PATH
    else
            SHLIB_PATH=$SHARED_LIBRARY_PATH
    fi
    export SHLIB_PATH
    # Start weblogic
    # change to weblogic home
    cd $WEBLOGIC_HOME
    PATH=$WL_HOME/bin:$JAVA_HOME/jre/bin:$JAVA_HOME/bin:$PATH
    $JAVACMD -classpath $CLASSPATH -Dbea.home=$BEA_HOME -Dweblogic.Domain=$DOMAIN_NAME -Dweblogic.Name=MyServer weblogic.Admin -ur
    l t3://localhost:$WEBLOGIC_PORT -username system -password $WLS_PW SHUTDOWNIt has obviously something to do with the line
    JAVA_OPTIONS=""-server -Xms1024m -Xmx1024m -Xmn320m -XX:SurvivorRatio=8 -Xverbosegc:file=/opt/bea/wlserver6.1/config/eGovStart
    ers/logs/gc.log -Dweblogic.system.gc.enabled=false ""I googled for this Xms1024m, Xmx1024m and it turns out to be for memory management for the java virtual machine.
    I don't know why it sais it can't find "-Xms256m" since it's not in the script.
    Anyone with some experience in this field who can help me out?

    ./stopWebLogic.sh[33]: -Xms256m: not found.
    this can be produced by something like this:
    javaoptions="-Xms256m" // or other option too
    $javacmd $javaoptions
    Now if javacmd has not been set, then $javacmd will be evaluated to the empty string, and the program to look for is the first part in $javaoptions, -Xms256m in our case.

  • Script for moving multiple subtitle clips in the works - EXAMPLES NEEDED!

    Hi everyone!
    One severe deficiency of DVD Studio Pro is the inability to move multiple subtitle clips back or forward in a track by an arbitrary offset.
    I ran into this problem while I was creating a DVD from an EyeTV recording of a DVB broadcast, the subtitles from which have to be extracted to a SON file and a bunch of .bmp images with a separate piece of software, ProjectX. For some reason, ProjectX messed up the subtitle timecodes, so I had to move the entire track forward by a fixed amount. Unable to do this inside DSP, and unable to find tools that would do this for SON files, I set out to code my own tool with Python.
    Currently, I have a very simplistic working version of the script, which I successfully used to shift the timecodes of the aforementioned SON file.
    This got me thinking: I can't be the only one who has faced this problem. So, in the spirit of giving something back to the community, I thought I'd try my hand at turning this little script into a versatile tool for timescaling several different subtitle formats.
    If possible, I would like to receive real-life examples of several different plaintext (no binary formats, thanks) subtitle formats from you guys, both those that DSP supports and those that it doesn't.
    For now the tool only shifts entire tracks and works on the command line, but who knows, maybe I'll create a GUI at some point and add the ability to shift specific subtitle clips instead of whole tracks - time permitting, of course.
    If you think you might have some juicy subtitles laying around, please reply or contact me directly by e-mail: elamaton (at) nic.fi. Don't worry, I won't redistribute anything you send me, it will only be used as test data.
    iMac Core Duo 20"   Mac OS X (10.4.7)  

    Sounds like a very good idea... but have you seen Subtitler:
    http://www.versiontracker.com/dyn/moreinfo/macosx/26322
    Not to say you won't make a better version, and I'd be delighted if you did! Manipulating subs in DVDSP is not something I do any more - I use an external text editor for any job where more than a few subs are needed.
    The problem in DVDSP is that you cannot extract the subs directly, you have to export an track item description which has the subs and time code buried within the XML. You might find that PHP will give you a web based tool to extract the subs and time codes and write a text file, which you can then manipulate.
    In fact, wouldn't a web based tool be a good idea? People could upload the track description, it would export the subs and you could get it to adjust the timecodes and write a text file back in the correct format to import back in to DVDSP. Once the subs are in a text file it is a simple matter to manipulate them further...

  • Shell script for DB backup

    HI,
    i have written some java code Database backup but there are some problems with that so now i need to write shell script for db backup.
    what i was doing in java code i was running command like that
    /usr/local/bin/tar cvzf /export/home/monitor/FILE_20091005.tar.gz FILES/*20091005.*which compress the all *20091005* files (myisam table files)
    but after compression file doesn't extract
    so i have to write shell script for that ..... can any body guide me how can i write that kind of script and put it in cron job.
    thanks

    soundar wrote:
    Hi all,
    I have migrated database from 8i to 10gr2.For Backup in 8i, we used a RMAN shell script (scheduled uding cron tab) to backup the database to Tape.(VERITAS BACKUP).
    I am new to 10G.I checked out the options to backup the database using Oracle Enterprise manager DB console.
    http://www.oracle.com/technology/obe/10gr2_db_single/ha/rman/rman_otn.htm#t1d
    I am planning to take a test backup using the steps mentioned inthe above url.Could any one suggest whcih is the best option for database backup,eiether to use Oracle Enterprise manager DB console or thru RMAN shell script for backup..?
    Edited by: soundar on Mar 9, 2010 10:53 PMDear soudar
    I woudn't suggest you to work with EM if you want to be a professional DBA. Start learning RMAN and use CLI instead of GUI
    Those who live by the GUI, die by the GUI

  • Script for temporary tablespace in 8.1.7.4.0

    Hi,
    I am working in oracle 8.1.7.4.0 and HP-UX os.I need a shell script which is to do the following tasks,
    1. create a new temporary tablespace
    2.assign the new temp tablespace to the database user level
    3.drop the old temp tablespace
    4. then create a temp tablespace with the old name
    5. then assign the new temp tablespace to the database user level
    6.drop the new temp tablespace
    Kindly provide me the script for oracle 8.1.7.4.0
    Rgds..

    here is one I prepared earlier (just like a TV chef)
    set echo on
    -- Create a New TEMP TEMP
    create temporary tablespace temp2
    tempfile 'dir/temp2.dbf' size 5M
    autoextend on next 1M maxsize unlimited extent management local uniform size 1M;
    -- Make the TEMP2 tablespace temp
    alter database default temporary tablespace temp2;
    -- Drop the orginal to recreate with new size
    drop tablespace temp including contents and datafiles;
    CREATE TEMPORARY TABLESPACE TEMP
    TEMPFILE 'dir/temp01.dbf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 30000M
    EXTENT MANAGEMENT LOCAL UNIFORM SIZE 2M;
    alter database default temporary tablespace temp;
    drop tablespace temp2 including contents and datafiles;

Maybe you are looking for

  • "Unable to load dataclass information from Sync Services"  Any ideas?

    I upgraded to iTunes 7.7 last night and now I get an annoying constant stream of errors that read "AppleMobileDeviceHelper has stopped working". Multiple reinstalls have not stopped it. Against my better judgement, I upgraded my phone to 2.0. Found o

  • Labview 2011 file layout in executable

    I am working on upgrading my projects from v8.6 to 2011. one thing i noticed was that the file layout in the built executable has been changed to treat the executable itself as the root directory of the code sources. To better address my problem, i w

  • CR Svr 08 -XI3.0 -Refresh List of Values after BIAR import

    Hello I use Crystal Server 2008 When I import reports from BIAR file, the lists of values that the reports use are created, and can be viewed/edited through Business Views Manager, on the destination. The data that the LOVs contain is the data from t

  • Clicking a file during "save as" changes name to that filename

    This is an old peeve about OS X. Do a save as... on this page. In the save dialog box, make sure you're in a subfolder (navigate into one if necessary). Also make sure you're in icon view or list view. Now assume you don't want to save the page into

  • Error during Returns Delivery in a Repair Order

    Hi, I am getting the follg error msg during Returns Delivery for a  Serviceable Material that is Serialized.: "Copying is not poss.because an entry is missing in Table TVCPL: LF RAS IRRS" However it maintain this in Copy Control for Deliveries, syste