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

Similar Messages

  • 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)

  • 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]));
    > }
    >
    >

  • 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 online table redefinition

    Hi,
    Could someone help me out in building a script for online table redefinition in AIX 11g, moving the table into a new table space.
    Thanks

    You are embarking upon a voyage in which you will expend a substantial effort reinventing the wheel.
    Look at Oracle DBMS_REDEFINITION built-in package.
    http://www.morganslibrary.org/reference/pkgs/dbms_redefinition.html
    and never do something outside the database, in a proprietary language, that can be done far more efficiently inside the RDBMS in a platform independent language.
    In other words, inside the database, I could code your entire project with error handling, in far less than an 15 minutes including testing.
    With a simple DDL statement, issued at the command prompt in SQL*Plus ... I could do it in less than 15 seconds: Your choice.
    ALTER TABLE <table_name> MOVE TABLESPACE <new_tablespace_name>;

  • ALUI Gateway Not Returning Scripts for Subset of Users

    We have a problem where the ALUI gateway is not returning some .NET scripts for a subset of users. We have the ALUI 6.5 portal and our using the .NET accelerator 3.1.
    The situation is that this subset of users request one of our portal pages via https, which then reaches through our firewall to our remote server which is running the .NET portlet. The .NET page is served and returned to the users correctly and quickly, but this particular subset of users do not see the result rendered in their browsers for about 3 minutes. A view html source in the browser, as well as tools like Fiddler, show the page is indeed in the browser, but it is stuck trying to request some .NET scripts, and only displays the page when those requests timeout.
    The .NET scripts that are problems are both WebResource.axd and ScriptResource.axd, which in some cases are in our .NET portlets because of the .NET framework itself, but in other cases they are there only because of the ALUI portal itself, when it munges the .NET portlet to handle multiple server forms and validators and such. These .axd scripts are gatewayed so that the client browser requests them through the ALUI gateway, which in turn requests them through our firewall to our remote server -- which always serves these scripts correctly and quickly according to the IIS logs. The problem seems to lie in the ALUI gateway, as it is receiving these scripts correctly and quickly, but it is not returning them to this subset of users. Instead the ALUI gateway seems to be processing for about 3 minutes, and eventually returns an html error page, which of course the client never sees since it is expecting javascript, but we can capture the error page via Fiddler and its just telling us there was a timeout -- the client browser just notes that there is a javascript error.
    The really bizarre part is that this only happens for a subset of users, which amounts to about 20% of our users. There are 2 things that delineate these users that we have found so far. First, these users have email addresses that are 27 - 30 characters long, and the email address is our login id. Note that both shorter and longer email addresses are OK, so there is not some limit to email addresses like this might sound like at first. Secondly, these users have to be in a particular branch of our ldap store, which means they are replicated across to the portal in a particular group. We can move these "bad" users into another branch of our ldap store and once they are replicated to the portal then they work fine, and then if we move them back they return to not working. We cannot find any other difference in our ldap branches or in the corresponding ALUI groups, plus its only the ones in that particular branch with the email lengths in that very specific range.
    The gatewayed requests for these scripts vary by user since the PTARGS in the gatewayed request include the integer userid, but that does not seem to matter because we can have a "good" user successfully request the script with a "bad" user's id, and we can have a "bad" user fail to successfully request the script with a "good" user's id. That seems to point to maybe the authentication cookie being the differentiating factor that determines whether or not a gatewayed request for one of these script files will succeed or fail. So far we have only seen the problem with these particular .net axd scripts, but that may simply be because we don't have many, if any, other scripts or resources that need to be gatewayed since we usually put resources on our imageserver -- these being different because .NET and/or the ALUI portal puts these references in there for us whether we like it or not. Long-term we can re-architect our .NET portlets to not get have these axd scripts, although as mentioned earlier, we also see the ALUI portal put these axd scripts in our portlets as part of their munging process -- so that is not in our control completely. We do need to test if this subset of users can successfully request other gatewayed resources or not -- this is actually the first time I thought of that test case, so all I can say right now is its axd scripts that we know are problems, but it may or may not be a bigger problem.
    One last comment, as we appear to have found a work-around, but it does not make sense at all, and its not our preferred solution, so we still very much believe there is a problem elsewhere -- most likely in the ALUI gateway, but possibly somehow related to authentication that we do not understand. Our work-around that so far seems to work is to make our remote server be accessed via https instead of http -- which matches the way the client browsers call our portal (https). Again that first doesn't make sense, since this is only a problem for a small subset of users -- obviously calling our remote server via http works successfully for all other users, so its not just is a simple case that we must match protocols or it won't work. We also use http successfully for our calls to the remote server for portlets that are Java, although its possible that they don't have any gatewayed resources. But we also would just prefer to not use https for our internal calls in our own network as there is no need for the extra overhead -- and by the way our dev and qa environments do use http even for these .NET portlets and do not have the same problem. What's different in our production environment? The only things that should be different are that we have multiple portal servers and multiple remote servers that are load balanced (not sure that's the right term for how the remote servers are combined) -- and of course we have a firewall between them that does not exist in dev or qa.
    So we would very much appreciate any thoughts on this, whether you've seen something like it before, or just have some additional insight into the gateway and/or authentication process that seems to be the issue.
    Thanks, Paul Wilson

    We've ran into this problem when using the Microsoft ReportViewer control. In our case, we found that the portal gateway malformed the urls containing webresource.axd, so the browser was unable to get the correct address to the files. Note that there are usually multiple links to the axd files, they return different resources depending on the query string they get.
    To solve the problem, we ended up with a bit of a hack solution, but it works well. We extracted the resources we needed from the ReportViewer control's assembly using Reflector, and then published them on the image server. The next piece was to override the Render method of the page that hosted the control. In our custom version of Render, we parsed the html of the page, and replaced the contents of the src= elements with pt:images// links. These processed just fine in the portal's transformer, and our resources started showing up.
    Our Render looks something like the following code sample. The "HACKReportViewerControlPortalImageGatewayFix" class has all of the code to do the parsing. In this case, it is specific to the report viewer, because it has some special considerations for parsing the urls. My bet if that your code will be quite custom as well. Therefore, I've not included this piece of code. The important piece below is the invocation of MyBase.Render, which tells the page to render all of it's contents. Once that method is done, all of the HTML for the page is in the writer. The ModifyImageTags method then parses the html, doing the necessary replacements. Finally, the modified html is written to the page's writer, so it can be output following the normal .net processes. Also note that when parsing for urls to replace, don't do all of them, just look for the ones containing axd.
    (VB.NET)
    Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
              Dim fixer As New HACKReportViewerControlPortalImageGatewayFix
              MyBase.Render(fixer.GetWriter)
              writer.Write(fixer.ModifyImageTags())
    End Sub
    This works great for images. However, if you are dealing with javascripts, I'm not sure if this will work for you - as some .NET controls send different scripts depending on the browser. For example, in IE, you get more buttons on the toolbar for the ReportViewer, so you get more javascript too. When using FF, you get less buttons, and less script. We didn't have a problem with the scripts, so we haven't needed to solve this one.
    As for timing, this type of solution doesn't take much to put together. You are really just doing some string parsing and replacements. If you are a regex ninja, it's probably even easier. We had our solution working in a day or two.
    An added benefit to this solution is that you are putting less bytes through the portal's gateway, and sending that traffic to the image server instead.

  • Preinstall script for MacOSXUpdCombo10.5.4 failed

    Tried installing 10.5.4 update automatically via Software Update - system hung.
    Downloaded combo update to manually install. Encountered error message: The Following install step failed: run preinstall script for MacOSXUpdCombo10.5.4. Contact the software manufacturer for assistance.
    Ran repair disk permissions. Same error.
    Tried installing under Root. Same error.
    Tried installing MacOSXUpdCombo10.5.2. Same error.
    Anyone encounter similar issue and knows solution please advise?
    Cheers.

    This is the little script in the installer that check to see if your machine is "eligible" for the update (many programs have it). Try downloading Pacifist, and drag the package from the update onto it. Have it install from there.
    If you experience rough performance, do an Archive and Install, and rerun the combo to 10.5.4.

  • How to make a Countdown timer Script for Live Streaming

    I have flash media server...
    Here's a Scenario:
    User wants to do a Live broadcast.. But.. they don't want to
    just press record and have it starting Streaming Right that second.
    They need a Delay to prepare for their Live Broadcasts.
    Whats the best way for a script for a user to decide how much
    time delay they need before Recording Starts?
    Ideally it would look like this:
    There is a separate window that allows the user to set the
    Self-Timer which will give them time to get ready for their live
    broadcasts.
    User sets length of Time Delay: 30 seconds, 1 minute, 2
    minutes, or even up to 5 minutes.
    User presses Start Broadcast or Record Button to start
    streaming Live Video.
    Then.. the Countdown Timer starts... and it displays in Big
    Digits... the countdown on their screen... "3...2...1...
    Broadcasting Live Now!"
    How would I do this?
    Hope someone can help

    Open the widget library panel and follow the link to Adobe Muse Exchange.
    There you find a fine little widget collection, named Andrews Prototypes.
    Load it, double-click the file, and in your library you will find a countdown widget.

  • Script for MAIL.app to detect russian characters in Subject of message

    Hi,
    is there anybody who could write a little script that detects russian charatcers (Azbuka) in Subject of Mail message and moves such message to Junk mailbox ?
    I would appreciate it
    Thank you.
    Peter

    Example:
    Return-Path: <[email protected]>
    Received: from [117.193.145.250] ([117.193.145.250])
    by mail.sunteq.sk (8.12.11/8.12.11) with ESMTP id n8TDJijC001464
    for <[email protected]>; Tue, 29 Sep 2009 15:20:06 +0200
    Received: from 117.193.145.250 by posta2.rcs.it; Tue, 29 Sep 2009 19:45:48 +0530
    Message-ID: <01ca413d$711ce510$fa91c175@qjh>
    From: =?koi8-r?B?IvXQ0sHXzMXOycUg5/PuIg==?= <[email protected]>
    To: <[email protected]>
    Subject: =?koi8-r?B?7s/XwdEg8/Ty7n05ez47uHxIPzr8/Dl8vTpuE=?=
    Date: Tue, 29 Sep 2009 19:45:48 +0530
    MIME-Version: 1.0
    Content-Type: text/plain;
    format=flowed;
    charset="koi8-r";
    reply-type=original
    Content-Transfer-Encoding: 8bit
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Mailer: Microsoft Outlook Express 6.00.4800.7764
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.4800.7764
    X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on mail.sunteq.sk
    X-Spam-Level:
    X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham
    version=2.63
    BÎÉÍaÎÉÅ!
    26 - 27 ÏËÔÑÂÒÑ 2009 Ç. × CaÎËÔ-ðeÔeÒÂyÒÇÅ:
    îï÷ùê ðïòñäïë çïóõäáòóô÷åîîïê üëóðåòôéúù
    óÔÒÏÉÔÅÌØÎÙÊ ÎÁÄÚÏÒ, ÁÄÍÉÎÉÓÔÒÁÔÉ×ÎÁÑ ÏÔ×ÅÔÓÔ×ÅÎÎÏÓÔØ
    âÕÄÕÔ ÒÁÓÓÍÏÔÒÅÎÙ ÎÁÉÂÏÌÅÅ ÓÌÏÖÎÙÅ É ÏÓÔÒÙÅ ×ÏÐÒÏÓÙ ÐÒÏ×ÅÄÅÎÉÑ ÅÄÉÎÏÊ ÇÏÓÕÄÁÒÓÔ×ÅÎÎÏÊ ÜËÓÐÅÒÔÉÚÙ, ÐÒÏÅËÔÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ É ÏÓÕÝÅÓÔ×ÌÅÎÉÑ ÇÏÓÕÄÁÒÓÔ×ÅÎÎÏÇÏ ÓÔÒÏÉÔÅÌØÎÏÇÏ ÎÁÄÚÏÒÁ!
    ÷ ðòïçòáííå íåòïðòéñôéñ:
    1. óÏ×ÒÅÍÅÎÎÁÑ ÚÁËÏÎÏÄÁÔÅÌØÎÏ-ÎÏÒÍÁÔÉ×ÎÁÑ ÂÁÚÁ ÉÎ×ÅÓÔÉÃÉÏÎÎÏ-ÓÔÒÏÉÔÅÌØÎÏÇÏ ÐÒÏÃÅÓÓÁ × Ô.Þ. ÎÏ×ÙÊ çÒÁÄÏÓÔÒÏÉÔÅÌØÎÙÊ ëÏÄÅËÓ òæ É ÄÒÕÇÉÅ ÄÏËÕÍÅÎÔÙ. éÚÍÅÎÅÎÉÑ × ÚÁËÏÎÏÄÁÔÅÌØÓÔ×Å òæ ÐÏ ×ÏÐÒÏÓÁÍ ÐÒÏ×ÅÄÅÎÉÑ ÇÏÓÕÄÁÒÓÔ×ÅÎÎÏÊ ÜËÓÐÅÒÔÉÚÙ ÐÒÏÅËÔÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ: ×ÓÔÕÐÌÅÎÉÅ × ÓÉÌÕ ÎÏ×ÏÇÏ ÒÅÇÌÁÍÅÎÔÁ ÐÒÏ×ÅÄÅÎÉÑ ÇÏÓÕÄÁÒÓÔ×ÅÎÎÏÊ ÜËÓÐÅÒÔÉÚÙ ÐÒÏÅËÔÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ É ÒÅÚÕÌØÔÁÔÏ× ÉÎÖÅÎÅÒÎÙÈ ÉÚÙÓËÁÎÉÊ ÏÔ 3 ÁÐÒÅÌÑ 2009Ç.
    2. îÏ×ÏÅ × ÐÏÄÇÏÔÏ×ËÅ ÉÓÈÏÄÎÏ-ÒÁÚÒÅÛÉÔÅÌØÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ ÎÁ ÐÒÏÅËÔÉÒÏ×ÁÎÉÅ É ÓÔÒÏÉÔÅÌØÓÔ×Ï; ÐÏÒÑÄÏË ÒÁÚÒÁÂÏÔËÉ, ÓÏÇÌÁÓÏ×ÁÎÉÑ É ÕÔ×ÅÒÖÄÅÎÉÑ ÐÒÏÅËÔÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ, ÅÅ ÓÏÓÔÁ× É ÓÏÄÅÒÖÁÎÉÅ; ÏÂÏÓÎÏ×ÁÎÉÅ ÉÎ×ÅÓÔÉÃÉÊ É ÐÒÏÅËÔÁ ÓÔÒÏÉÔÅÌØÓÔ×Á. óÔÏÉÍÏÓÔØ ÐÒÏÅËÔÎÏ-ÉÚÙÓËÁÔÅÌØÓËÉÈ ÒÁÂÏÔ. ðÏÒÑÄÏË ÐÒÏ×ÅÒËÉ ÄÏÓÔÏ×ÅÒÎÏÓÔÉ ÚÁÑ×ÌÅÎÎÏÊ ÓÔÏÉÍÏÓÔÉ ÓÔÒÏÉÔÅÌØÓÔ×Á É ÓÔÏÉÍÏÓÔÉ ÐÒÏÅËÔÎÏ-ÉÚÙÓËÁÔÅÌØÎÙÈ ÒÁÂÏÔ.
    3. ðÒÏ×ÅÄÅÎÉÅ åÄÉÎÏÊ ÇÏÓÕÄÁÒÓÔ×ÅÎÎÏÊ ÜËÓÐÅÒÔÉÚÙ ÐÒÏÅËÔÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ É ÒÅÚÕÌØÔÁÔÏ× ÉÎÖÅÎÅÒÎÙÈ ÉÚÙÓËÁÎÉÊ. ôÒÅÂÏ×ÁÎÉÑ Ë ÓÏÓÔÁ×Õ ÐÒÏÅËÔÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ, ÓÒÏËÉ ÐÒÏ×ÅÄÅÎÉÑ ÜËÓÐÅÒÔÉÚÙ.
    4. ÷ÙÄÁÞÁ ÒÁÚÒÅÛÅÎÉÊ ÎÁ ÓÔÒÏÉÔÅÌØÓÔ×Ï. óÏÓÔÁ× ÄÏËÕÍÅÎÔÏ×; ÓÏÄÅÒÖÁÎÉÅ ÇÒÁÄÏÓÔÒÏÉÔÅÌØÎÏÇÏ ÐÌÁÎÁ ÕÞÁÓÔËÁ; ÓÐÅÃÉÆÉËÁ ×ÙÄÁÞÉ ÒÁÚÒÅÛÅÎÉÊ ÎÁ ÒÁÚÌÉÞÎÙÅ ×ÉÄÙ ÏÂßÅËÔÏ×.
    5. ôÒÅÂÏ×ÁÎÉÑ óÎÉð É ÄÒÕÇÉÈ ÎÏÒÍÁÔÉ×Ï× ÐÒÉ ÐÒÏÅËÔÉÒÏ×ÁÎÉÉ É ÓÔÒÏÉÔÅÌØÓÔ×Å, ÐÒÁËÔÉËÁ ÉÈ ÓÏÂÌÀÄÅÎÉÑ.
    6. ðÏÄÇÏÔÏ×ËÁ ÚÁÄÁÎÉÑ ÎÁ ÐÒÏÅËÔÉÒÏ×ÁÎÉÅ ÏÂßÅËÔÁ, ÏÐÒÅÄÅÌÅÎÉÅ ÓÔÏÉÍÏÓÔÉ ÐÒÏÅËÔÎÙÈ ÒÁÂÏÔ, ÓÏÇÌÁÓÏ×ÁÎÉÅ ÐÒÏÅËÔÎÙÈ ÒÁÂÏÔ.
    7. çÏÓÕÄÁÒÓÔ×ÅÎÎÙÊ ÓÔÒÏÉÔÅÌØÎÙÊ ÎÁÄÚÏÒ. ëÏÍÍÅÎÔÁÒÉÉ Ë ÒÕËÏ×ÏÄÑÝÉÍ ÄÏËÕÍÅÎÔÁÍ.
    8. ÷ÙÄÁÞÁ ÒÁÚÒÅÛÅÎÉÊ ÎÁ ××ÏÄ ÏÂßÅËÔÏ× × ÜËÓÐÌÕÁÔÁÃÉÀ.
    9. ðÒÁËÔÉËÁ ÐÒÉ×ÌÅÞÅÎÉÑ Ë ÁÄÍÉÎÉÓÔÒÁÔÉ×ÎÏÊ ÏÔ×ÅÔÓÔ×ÅÎÎÏÓÔÉ ÚÁ ÎÁÒÕÛÅÎÉÑ × ÓÆÅÒÅ ÇÒÁÄÏÓÔÒÏÉÔÅÌØÎÏÊ ÄÅÑÔÅÌØÎÏÓÔÉ.
    10. üËÏÎÏÍÉÞÅÓËÁÑ ÜÆÆÅËÔÉ×ÎÏÓÔØ ÉÎ×ÅÓÔÉÃÉÊ É ÅÅ ÏÂÏÓÎÏ×ÁÎÉÅ × ÐÒÏÅËÔÁÈ ÓÔÒÏÉÔÅÌØÓÔ×Á. ïÂÏÓÎÏ×ÁÎÉÅ ÉÎ×ÅÓÔÉÃÉÊ.
    BoÐpocÙ ÂyÄyÔ paccÍaÔpÉ×aÔØcÑ Îa ÐpoÔÑÖeÎÉÉ Ä×yx ÄÎeÊ
    c 10:00 Äo 17:00 × ÃeÎÔpe CaÎËÔ-ðeÔepÂypÇa.
    úáðéóù÷áêôåóø! (8.1.2.) 9.8.2.9.9.3.8.

  • I am in need of ai script for arcing text

    i am in need of ai script for arcing text

    A little vague aren't we… Is this the kind of arcing you mean? Text along a curve or do you mean distorting into an arch like some plug-in can?
    #target illustrator
    var doc = app.activeDocument;
    doc.defaultFilled = false, doc.defaultStroked = true;
    var textPath = doc.pathItems.ellipse( 0, 0, doc.width, doc.height );
    textPath.pathPoints[3].selected = PathPointSelection.ANCHORPOINT;
    app.cut();
    doc.selection = null;
    app.redraw();
    var tp = doc.textFrames.pathText( doc.pathItems[0], 0, 0, TextOrientation.HORIZONTAL );
    tp.textRange.paragraphAttributes.justification = Justification.CENTER;
    tp.textRange.characterAttributes.size = 60;
    tp.contents = 'I am in need of ai script…';
    var tpd = tp.duplicate();
    tpd.translate( 0, -150 );
    tpd.textRange.characterAttributes.size = 90;
    tpd.contents = '…for arcing text?';

  • 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()

  • When I go to Preview to view a photo it shows up for less than a second then disappears and just leaves a gray box where the photo should be. iMac (Retina 5K, 27-inch, Late 2014). I need Preview for work.

    After the OS X Yosemite 10.10.3 update When I go to use Preview to view a photo it shows up for less than a second then disappears and just leaves a gray box where the photo should be. iMac (Retina 5K, 27-inch, Late 2014). I need Preview for work.

    1. This procedure is a diagnostic test. It changes nothing, for better or worse, and therefore will not, in itself, solve the problem. But with the aid of the test results, the solution may take a few minutes, instead of hours or days.
    The test works on OS X 10.7 ("Lion") and later. I don't recommend running it on older versions of OS X. It will do no harm, but it won't do much good either.
    Don't be put off by the complexity of these instructions. The process is much less complicated than the description. You do harder tasks with the computer all the time.
    2. If you don't already have a current backup, back up all data before doing anything else. The backup is necessary on general principle, not because of anything in the test procedure. Backup is always a must, and when you're having any kind of trouble with the computer, you may be at higher than usual risk of losing data, whether you follow these instructions or not.
    There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    3. Below are instructions to run a UNIX shell script, a type of program. As I wrote above, it changes nothing. It doesn't send or receive any data on the network. All it does is to generate a human-readable report on the state of the computer. That report goes nowhere unless you choose to share it. If you prefer, you can act on it yourself without disclosing the contents to me or anyone else.
    You should be wondering whether you can believe me, and whether it's safe to run a program at the behest of a stranger. In general, no, it's not safe and I don't encourage it.
    In this case, however, there are a couple of ways for you to decide whether the program is safe without having to trust me. First, you can read it. Unlike an application that you download and click to run, it's transparent, so anyone with the necessary skill can verify what it does.
    You may not be able to understand the script yourself. But variations of it have been posted on this website thousands of times over a period of years. The site is hosted by Apple, which does not allow it to be used to distribute harmful software. Any one of the millions of registered users could have read the script and raised the alarm if it was harmful. Then I would not be here now and you would not be reading this message. See, for example, this discussion.
    Nevertheless, if you can't satisfy yourself that these instructions are safe, don't follow them. Ask for other options.
    4. Here's a general summary of what you need to do, if you choose to proceed:
    ☞ Copy a particular line of text to the Clipboard.
    ☞ Paste into the window of another application.
    ☞ Wait for the test to run. It usually takes a few minutes.
    ☞ Paste the results, which will have been copied automatically, back into a reply on this page.
    These are not specific instructions; just an overview. The details are in parts 7 and 8 of this comment. The sequence is: copy, paste, wait, paste again. You don't need to copy a second time.
    5. Try to test under conditions that reproduce the problem, as far as possible. For example, if the computer is sometimes, but not always, slow, run the test during a slowdown.
    You may have started up in "safe" mode. If the system is now in safe mode and works well enough in normal mode to run the test, restart as usual. If you can only test in safe mode, do that.
    6. If you have more than one user, and the one affected by the problem is not an administrator, then please run the test twice: once while logged in as the affected user, and once as an administrator. The results may be different. The user that is created automatically on a new computer when you start it for the first time is an administrator. If you can't log in as an administrator, test as the affected user. Most personal Macs have only one user, and in that case this section doesn’t apply. Don't log in as root.
    7. Load this linked web page (on the website "Pastebin.") The title of the page is "Diagnostic Test." Below the title is a text box headed by three small icons. The one on the right represents a clipboard. Click that icon to select the text, then copy it to the Clipboard on your computer by pressing the key combination command-C.
    If the text doesn't highlight when you click the icon, select it by triple-clicking anywhere inside the box. Don't select the whole page, just the text in the box.
    8. Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Click anywhere in the Terminal window to activate it. Paste from the Clipboard into the window by pressing command-V, then press return. The text you pasted should vanish immediately.
    9. If you see an error message in the Terminal window such as "Syntax error" or "Event not found," enter
    exec bash
    and press return. Then paste the script again.
    10. If you're logged in as an administrator, you'll be prompted for your login password. Nothing will be displayed when you type it. You will not see the usual dots in place of typed characters. Make sure caps lock is off. Type carefully and then press return. You may get a one-time warning to be careful. If you make three failed attempts to enter the password, the test will run anyway, but it will produce less information. If you don't know the password, or if you prefer not to enter it, just press return three times at the password prompt. Again, the script will still run.
    If you're not logged in as an administrator, you won't be prompted for a password. The test will still run. It just won't do anything that requires administrator privileges.
    11. The test may take a few minutes to run, depending on how many files you have and the speed of the computer. A computer that's abnormally slow may take longer to run the test. While it's running, a series of lines will appear in the Terminal window like this:
    [Process started]
            Part 1 of 8 done at … sec
            Part 8 of 8 done at … sec
            The test results are on the Clipboard.
            Please close this window.
    [Process completed]
    The intervals between parts won't be exactly equal, but they give a rough indication of progress. The total number of parts may be different from what's shown here.
    Wait for the final message "Process completed" to appear. If you don't see it within about ten minutes, the test probably won't complete in a reasonable time. In that case, press the key combination control-C or command-period to stop it and go to the next step. You'll have incomplete results, but still something.
    12. When the test is complete, or if you stopped it because it was taking too long, quit Terminal. The results will have been copied to the Clipboard automatically. They are not shown in the Terminal window. Please don't copy anything from there. All you have to do is start a reply to this comment and then paste by pressing command-V again.
    At the top of the results, there will be a line that begins with the words "Start time." If you don't see that, but instead see a mass of gibberish, you didn't wait for the "Process completed" message to appear in the Terminal window. Please wait for it and try again.
    If any private information, such as your name or email address, appears in the results, anonymize it before posting. Usually that won't be necessary.
    13. When you post the results, you might see an error message on the web page: "You have included content in your post that is not permitted," or "You are not authorized to post." That's a bug in the forum software. Please post the test results on Pastebin, then post a link here to the page you created.
    14. This is a public forum, and others may give you advice based on the results of the test. They speak for themselves, not for me. The test itself is harmless, but whatever else you're told to do may not be. For others who choose to run it, I don't recommend that you post the test results on this website unless I asked you to.
    Copyright © 2014, 2015 by Linc Davis. As the sole author of this work (including the referenced "Diagnostic Test"), I reserve all rights to it except as provided in the Use Agreement for the Apple Support Communities website ("ASC"). Readers of ASC may copy it for their own personal use. Neither the whole nor any part may be redistributed.

  • "samba-discovery". An automounter script for windows shares

    Hi.
    At the last lan party I found it quite annoying to mount samba shares by hand all the time (as I don't use a smb capable browser with fuse like dolphin or the like). So here's what I've come up with. Explenations on how it works are at the start of the script. You can also download it directly from here. Basically you run it and anything available on the lan will be tidily mounted to /mnt/samba-discovery/*.
    #!/bin/bash
    # Hi and welcome to this samba/windows share automounting script.
    # It will:
    # - Scan the network for windows/samba hosts.
    # - Mount all their available guest shares
    # - If rerun it will check if all shares are still accesible
    # - Unmount everything if you use the -u option
    # It will not:
    # - Work on password protected shares. No idea what will happen,
    # I guess mount.cifs will spit an error but the script will continue
    # Run it without options to mount/rescan, use -u to unmount everything.
    # Before running it please specify the options below.
    # Post questions on the Archlinux forum: http://bbs.archlinux.org/viewtopic.php?pid=596979#p596979
    # MOST IMPORTANTLY: If it eats all your files for breakfast, it's none
    # of my responsibility! It should be quite safe though because it's
    # always checking if a dir is empty before deleting it.
    ### Options
    # Specify the name of your network adapter (e.g. eth0):
    netiface='eth0'
    # Specify which range of IPs you're interested in (less is faster)
    lowend=1
    highend=20
    ### Code
    # Prepare samba-discovery folder
    if [[ ! -d /mnt/samba-discovery/ ]]; then
    mkdir /mnt/samba-discovery
    fi
    # Unmount all shares and clean up directories using -u
    umountcount=0
    uhostcount=0
    if [[ $1 == "-u" ]]; then
    shopt -s nullglob dotglob
    dirs=(/mnt/samba-discovery/*)
    (( ${#dirs[@]} )) || sharefolders=1
    shopt -u nullglob dotglob
    if [[ ! $sharefolders == 1 ]]; then
    for i in /mnt/samba-discovery/*/*; do
    umount "$i" 2>/dev/null
    cd "$i" 2>/dev/null
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: target directory not empty although share unmounted"
    echo ">>> aborting. please investigate directory:"
    echo " $i"
    exit 1
    else
    dirempty=0
    rm -R "$i"
    echo " share on $i unmounted, folder removed."
    ((umountcount++))
    fi
    done
    for i in /mnt/samba-discovery/*; do
    umount "$i" 2>/dev/null
    cd "$i" 2>/dev/null
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: target directory not empty although all shares unmounted"
    echo ">>> aborting. please investigate directory:"
    echo " $i"
    exit 1
    else
    dirempty=0
    rm -R "$i"
    echo " parent folder $i removed."
    ((uhostcount++))
    fi
    done
    echo "-> Removed $umountcount shares and $uhostcount parent folders"
    exit 0
    else
    echo "no parent folder found, nothing to unmount"
    exit 0
    fi
    fi
    # Normal run. Scan for shares which are no longer on the network...
    if [[ ! $1 == "" ]]; then
    echo "Invalid option. Aborted"
    exit 1
    fi
    shopt -s nullglob dotglob
    dirs=(/mnt/samba-discovery/*)
    (( ${#dirs[@]} )) || sharefolders=1
    shopt -u nullglob dotglob
    if [[ ! $sharefolders == 1 ]]; then
    echo ':: Cleaning up orphaned shares...'
    cleancount=0
    for i in /mnt/samba-discovery/*/*; do
    if [[ ! $(ls $i 2>/dev/null) ]]; then
    umount "$i" 2>/dev/null
    cd "$i" 2>/dev/null
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: target directory not empty although share unmounted"
    echo ">>> aborting. please investigate directory:"
    echo " $i"
    exit 1
    else
    dirempty=0
    rm -R "$i"
    echo " share on $i no longer accesible, removed."
    ((cleancount++))
    fi
    else
    if [[ ! $(cat /proc/mounts | grep "cifs" | awk '{print $2}' | grep $i) ]]; then
    cd "$i" 2>/dev/null
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: target directory not empty although nothing mounted there"
    echo ">>> aborting. please investigate directory:"
    echo " $i"
    exit 1
    else
    dirempty=0
    rm -R "$i"
    echo " nothing mounted on $i, removed."
    ((cleancount++))
    fi
    fi
    fi
    done
    echo "-> Cleaned out $cleancount shares"
    fi
    # ... and then scan for new hosts and mount shares
    echo ':: Scanning for new hosts and shares...'
    netaddr=$(ifconfig eth0 | grep "inet addr" | awk '{print $2}' | awk -F ":" '{print $2}' | awk -F "." '{print $1"."$2"."$3}')
    hostcount=0
    sharecount=0
    for ((ip=$lowend; ip<=$highend; ip++)); do
    printf " scanning $netaddr.$ip...\r"
    if (( $(nmap -PN -p139,445 "$netaddr.$ip" | grep -e "139/tcp open" -e "445/tcp open" | wc -l) == 2 )); then
    hostwinname="$( nmblookup -A $netaddr.$ip | grep "<00>" | grep -v "<GROUP>" | awk '{print $1}')"
    hostdirname="$(echo $hostwinname | tr [:upper:] [:lower:])"
    echo " found $hostwinname on $netaddr.$ip"
    IFS=$'\n' shares=($(smbclient -N -gL \\\\$netaddr.$ip\\ 2>&1 | grep -e "Disk|" | grep -v '\$' | awk -F "|" '{print $2}'))
    for share in ${shares[*]}; do
    sharedir="$(echo $share | sed s/\ /_/g | tr [:upper:] [:lower:])"
    if [[ "$(cat /proc/mounts | grep ",unc=\\\\\\\\$netaddr.$ip\\\\$share,")" ]]; then
    echo " share "$share" already mounted in /mnt/samba-discovery/$hostdirname/$sharedir"
    else
    if [[ ! -d "/mnt/samba-discovery/$hostdirname" ]]; then
    mkdir "/mnt/samba-discovery/$hostdirname"
    #echo "$hostwinname:$hostdirname:$netaddr.$ip" >> /mnt/samba-discovery/$hostdirname/ip.txt
    fi
    if [[ ! -d "/mnt/samba-discovery/$hostdirname/$sharedir" ]]; then
    mkdir "/mnt/samba-discovery/$hostdirname/$sharedir"
    else
    cd "/mnt/samba-discovery/$hostdirname/$sharedir"
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: mounting directory not empty although share not mounted!"
    echo ">>> aborting. please investigate directory:"
    echo " /mnt/samba-discovery/$hostdirname/$sharedir"
    exit 1
    fi
    dirempty=0
    fi
    mount "//192.168.1.$ip/$share" "/mnt/samba-discovery/$hostdirname/$sharedir" -o guest 2>/dev/null
    echo " mounted "$share" in /mnt/samba-discovery/$hostdirname/$sharedir"
    ((sharecount++))
    fi
    done
    ((hostcount++))
    fi
    done
    echo "-> Mounted $sharecount shares from $hostcount hosts."
    # Remove samba-discovery folder if it is empty
    if [[ -d /mnt/samba-discovery/ ]]; then
    cd "/mnt/samba-discovery/"
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || sambadirempty=1
    shopt -u nullglob dotglob
    if [[ sambadirempty == 1 ]]; then
    rm -R /mnt/samba-discovery/
    fi
    fi
    Here's some sample output of how it will look, including one orphaned share and a new one on a rerun of the script:
    [root@Mothership samba-discovery]# /home/medja/scripts/samba-discovery
    :: Cleaning up orphaned shares...
    share on /mnt/samba-discovery/blackrabbit/conflict_denied_ops no longer accesible, removed.
    -> Cleaned out 1 shares
    :: Scanning for new hosts and shares...
    found BLACKRABBIT on 192.168.1.2
    share CD-Images already mounted in /mnt/samba-discovery/blackrabbit/cd-images
    share CD-Images2 already mounted in /mnt/samba-discovery/blackrabbit/cd-images2
    share Filme already mounted in /mnt/samba-discovery/blackrabbit/filme
    share Filme2 already mounted in /mnt/samba-discovery/blackrabbit/filme2
    mounted Music Library in /mnt/samba-discovery/blackrabbit/music_library
    found MOTHERSHIP on 192.168.1.4
    share space already mounted in /mnt/samba-discovery/mothership/space
    found EEE on 192.168.1.5
    share SharedDocs already mounted in /mnt/samba-discovery/eee/shareddocs
    -> Mounted 1 shares from 3 hosts.
    Last edited by Shapeshifter (2009-08-07 18:51:05)

    thanks a lot, i wanted to write that script for a long time, but never got around. one thing though, you shouldn't mount stuff in a subfolder of /mnt because /mnt itself should be kept for such purposes (unix file hierarchy standards, afaik)
    but that should be easily fixed by myself
    cheers
    Phil
    Last edited by Heller_Barde (2009-08-07 21:42:46)

  • My buttons won't work!!!! I've only had my nano for less than 3 months!!

    I've had my Nano ipod for less than 3 months. Today at work while I was listening to it, I accidentally spilt water on the table that the ipod was sitting on. My Nano ipod has a plastic case for protection and I leave it on at all times. A little bit of water may have penetrated the Ipod. But I wiped it dry straight away.
    I have tried EVERYTHING prescribed on this website. The backlight comes on everytime I shift the hold button from left to right. The PROBLEM is with the main buttons. I have charged it for several hours. I'm stuck on the main menu. I cannot get the buttons to work at all.
    Does anyone have any suggestions on how to rectify this problem? I don't want to send it to the service centre until I am 100% sure that there's nothing that I can do to fix it.
    The other thing, my friend bought my nano in New York city and brought it back for me in Sydney Australia. Do you think I'm going to have any problems getting it fixed here?
    Thanks a million!!

    I was listening to my iPod with a friend of mine. We were listening to a Maroon 5 song, and we wanted to change it, so I hit menu. It freezes up. Mine occasionally freezes every now and again, so I tried to reset it. It does it, but the main buttons don't work. I can reset it, but that's about it, and the hold works. I tried restoring it, and I don't know what to do now. I had brought it to the beach, but I kept it in a beach bag and its case the whole time. It did work before, then it just froze.
    Anyone have any suggestions? I've had it since January and don't want it to be dead yet..
      Windows XP  

  • Need help creating script for specific instance

    I am having trouble coming up with a working script for this part of the pricing form I am editing. I am trying to get the calculation fields to the right to change and populate in the respective field based on the selection in the Material Type dropdown. Would it be less of a headache if I made another text field to calculate the LE versions separately instead of trying to merge them into one field? I have attached screenshots below to give you an example of what I'm working with. Any help with this is greatly appreciated!
    Script I'm tinkering with at the moment:
    //Dropdown37 = Quantity Field
    //Type of Door IB = Material Type dropdown
    var x = this.getField("Type of Door IB").value;
    if ( x = 1468 ) event.value = x * this.getField("Dropdown37").value;
    if (x = 1202) event.value = x * this.getField("Dropdown37").value;
    else event.value = 0;

    The comparison operator in JS is "==", so change this line:
    if ( x = 1468 )
    To this:
    if ( x == 1468 )
    (as well as the other if-statement).

Maybe you are looking for