[Solved] Date command not working, maxing out memory and cpu.

So I've encountered and incredibly strange problem.
Today, I was working on a script for my bar panel. I was following z3bra's guide "Meeting at The Bar Really simple stuff, nothing harmful:
#! /bin/sh
# Fox - do whatever
# Gathers various info to be displayed on a panel using BAR
clock () {
date '+%a %y/%m/%d %I:%M'
volume () {
sed -n 's/^.*\[\([0-9]\+\)%.*$/\1%/p'
cpuload () {
mpstat 1 1 | awk '$3 ~ /CPU/ { for(i=1;i<=NF;i++) { if ($i ~ /%idle/) field=i } } $3 ~ /all/ { print 100 - $field }'
memused() {
read t f <<< `grep -E 'Mem(Total|Free)' /proc/meminfo |awk '{print $2}'`
bc <<< "scale=2; 100 - $f / $t * 100" | cut -d. -f1
network() {
#The Following assumes you have 3 interfaces: loopback, ethernet, wifi
read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'`
# iwconfig returns an error code if the interface tested has no wireless
# extensions
if iwconfig $int1 >/dev/null 2>&1; then
wifi=$int1
eth0=$int2
else
wifi=$int2
eth0=$int1
fi
# in case you have only one interface, just set it here:
# int=eth0
# this line will set the variable $int to $eth0 if it's up, and $wifi
# otherwise. I assume that if ethernet is UP, then it has priority over
# wifi. If you have a better idea, please share :)
ip link show $eth0 | grep 'state UP' >/dev/null && int=$eth0 || int=$wifi
#This is now the time to see if network is up or not. For that, a simple ping would do the trick:
# just output the interface name. Could obviously be done in the 'ping'
# query
echo -n "$int"
# Send a single packet, to speed up the test. I use google's DNS 8.8.8.8,
# but feel free to use any ip address you want. Be sure to put an IP, not a
# domain name. You'll bypass the DNS resolution that can take some precious
# miliseconds ;)
ping -c 1 8.8.8.8 >/dev/null 2>&1 && echo "connected" || echo "disconnected"
groups() {
cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3+1}'`
tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'`
# Desktop numbers start at 0. if you want desktop 2 to be in second place,
# start counting from 1 instead of 0. But wou'll lose a group
for w in `seq 1 $((cur - 1))`; do line="${line}="; done
# enough =, let's print the current desktop
line="${line}|"
# En then the other groups
for w in `seq $((cur + 2)) $tot`; do line="${line}="; done
# don't forget to print that line!
if (($cur < "10"))
then echo $line=
else echo $line
fi
nowplaying() {
cur=`mpc current`
test -n "$cur" && echo $cur || echo "- stopped -"
# This loop will fill a buffer with our infos, and output it to stdout.
while :; do
buf=""
buf="${buf} [$(groups)] -- "
buf="${buf} CLK: $(clock) -"
buf="${buf} NET: $(network) -"
buf="${buf} CPU: $(cpuload)%% -"
buf="${buf} RAM: $(memused)%% -"
buf="${buf} VOL: $(volume)%%"
buf="${buf} MPD: $(nowplaying)"
echo $buf
# use `nowplaying scroll` to get a scrolling output!
sleep 1 # The HUD will be updated every second
done
Once I finished it up, I ran it, and nothing happened. So I took a break, and then came back to troubleshoot it. I ran
bash -x panel.sh
and didn't see anything weird so I started to just run each command and make sure my syntax was alright. However, right away when I ran date, no output was generated and within seconds my computer came to a crawl, so I rebooted manually.
Now, whenever I simply run (without any parameters)
date
the exact same thing happens and within seconds htop reports 100% memory usage and nearly 100% CPU usage on all four cores. Luckily, if I'm fast enough, ctrl-c still ends the operation of date.
I've tried reinstalling coreutils,but that doesn't seem to fix the problem and I can't completely remove it first since a lot of things depend on it.. I have no clue how to even start fixing this. Anyone have an idea?
Realized where I went stupid, in my ~/Scripts folder, I made a script named date without remember that I had recently added that folder to my PATH. So I created a recursive loop that within seconds would crash my computer... oops.
Last edited by FoxzTrot (2015-02-08 04:00:24)

I have found the solution! I post how I managed in case someone else has the same issue.
You have to go to "Settings" -> "Settings Editor".
There, there is a "display" entry.
When you open the tree, you can see both of your displays (in my case, LVDS1 and VGA1).
Under VGA1 (the "extra" monitor), there is a "Position" entry. There, you need to set the "X" variable to the last pixel of the other display resolution.
E.g.: if you principal display is a "1366x768", then the "X" value will be 1366.
You can also play on the "Y" if your screens are not horizontally aligned, but 0 should be fine.
I hope this helps :-)

Similar Messages

  • [SOLVED]find command not working correctly new version of findutils...

    After upgrading my findutils from 4.2.33-1 to 4.4.0-1, it is not working the way it used to. I downgraded to the old one and it is working fine again. However, I am wondering why the newer version can't do what I want it to...
    Typically I run the following script to apply mp3gain to my music collection (albums and individual songs):
    #!/bin/bash
    echo Albums...
    find . -mindepth 3 -iname '*.mp3' -execdir mp3gain -k -a {} +
    echo Single tracks...
    find . -maxdepth 2 -iname '*.mp3' -exec mp3gain -k -r {} +
    On the old version, for the albums, the "find" function works as expected by examining the entire album before applying gain. With the new findutils version, the albums are being analysed song-by-song. I suppose since the new version of findutils, there is just a different method to do what I wanted before with -execdir. Does anyone know how to do it on the new version?
    Last edited by tony5429 (2008-07-19 06:29:41)

    Cool. Thanks for the suggestion. I ended up going with...
    #!/bin/bash
    echo Albums...
    for album in */*
    do
    cd "$album" > /dev/null 2>&1
    if [ $? = 0 ]
    then
    mp3gain -k -a *.mp3
    cd ..
    cd ..
    fi
    done
    echo Single tracks...
    find . -maxdepth 2 -iname '*.mp3' -exec mp3gain -k -r {} +
    exit 0

  • I NEED HELP My cellular data is not working! I called and went to Apple INC. And At

    So after July 4th 2013 I experienced wi-fi problems. I wasn't able to keep connected and i kept getting kicked out my own wi-fi. I left it continue a while because i thought it was only temporary. But i noticed my cellular data with at&t hadn't been working properly for about a month. Then it started getting worse till the point now I cannot use nor wi-fi nor cellular data. I called Apple Inc., they thought it was a bug, and we took procedures for trying to fix it. We restarted it, and reset network settings. Finally they suggested calling or going into at&t. I called first and we did almost same exact procedures as apple. So I decided going into At&t, they changed my original sim card and was only recieving 1 bar of signal, but i was bad. I couldn't do anything. After they scheduled and appointment at Apple store, ugh! which was such bad service. People everywhere and rushed through my problem and he didn't even let me explain. He only suggested I buy their ipad exchaging mine. In which come on. I couldn't back up my photos and stuff that instant. I asked him to give me a minute and he never came back. Like what was the point of that appointmet? After leaving I walked about 2 streets down and all my cellular data bars and 3g were up. It only worked there and when i was driving home and got home nothing once again. Not even inside the store. i mean others wi-fi works in some areas and my cellular data was good until now . I know At&t told me they were not experiencing any technical issues and everything was good, so i know its not due to that. My siste's mini ipad is working fine, so is my sisters ipod. I really need help and someone to take time in reading this and or helping me.Please thanks!

    Has any had you try a reset yet? Sometimes the WiFi &amp; Cellular anntennas get wacky.
    Hold Sleep/Wak &amp; Home buttons until the screen goes dark and you see the Apple logo

  • Master data check not working when loading into and ODS object

    Hi guys,
    we are loading transactional data into an ODS from a flat file.
    In the infopackage, we have checked the option :                                                
    "Do not update data if no master data exists for a characteristic".
    This option seems to be unreliable :
    For some characteristics (it seems those loaded using transfer rules (routines)), incorrect data is still loaded into the ODS even if no entry exist in the associated infoobject master data table.
    Any help appreciated.
    Many thanks !
    Pierre-Yves

    Hi Dear,
       please delete all the incorrect master data from the master data characteristic first and then try to uploading the data again .It should work, because there migth be some master data created when data were loaded with out the check before.
    And please check whether all your characteristic info object are of master data , I mean that in the infoobject defination you have checked the master data check box on the info object. If you have only text then it might fail the master data check.
    hope this help.
    cheers,
    balaji
    Message was edited by: Balaji NS

  • I have not been able to use iTunes for several months.  Every time I open iTunes, it freezes by computer such that there is about a minutes between each action.  I am running iTunes 11 on Mac OS 10.6.8 and have a computer with maxed out memory.

    I have not been able to use iTunes for several months.  Every time I open iTunes, it freezes by computer such that there is about a minutes between each action.  I am running iTunes 11 on Mac OS 10.6.8 and have a computer with maxed out memory.  Help!  I can't access my iTunes content.

    I have not been able to use iTunes for several months.  Every time I open iTunes, it freezes by computer such that there is about a minutes between each action.  I am running iTunes 11 on Mac OS 10.6.8 and have a computer with maxed out memory.  Help!  I can't access my iTunes content.

  • I can't send out email using my iPhone4. I tried to follow the step provided to solve but still not working. What should I do?

    I can't send out email using my iPhone4. I tried to follow the step provided to solve but still not working. What should I do?

    Contact your mail provider and get the CORRECT settings for the outgoing server to set up on your phone.

  • Why is my BDC_CURSOR command not working to position the cursor?

    Why is my BDC_CURSOR command not working to position the cursor?  Here are the details regarding my issue.
    I am writing a BDC to mass delete routing material assignments using transaction CA02.  I am OK to navigate through the initial screen to go to the Header screen and from here I am OK to navigate to the Material Assignments screen.  But once here, I cannot get the BDC_CURSOR command to take me into the list.  Here are the commands I am using.  Please let me know what I may try differently.
    CA02 Material Assignment - Set position  <-- this resets list of materials to correct position
      PERFORM bdc_dynpro      USING 'SAPLCZDI'   '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'  'RC27X-ENTRY_ACT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'   '=ENT1'.
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'  c_position.
    CA02 Material Assignment - Delete
      PERFORM bdc_dynpro      USING 'SAPLCZDI'   '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'  'MAPL-MATNR(01)'.    <-- this is not working to set the cursor into the list
      PERFORM bdc_field       USING 'BDC_OKCODE'  '=LOE'.             " trash can
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'  c_position.
    CA02 Material Assignment - Green Check OK
      PERFORM bdc_dynpro      USING 'SAPLCZDI'   '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'  'RC27X-ENTRY_ACT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'   '=BACK'.            " check mark
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'  c_position.

    Thank you for your reply.
    I had used SM35 to record.  However, I was not aware of the "create program" feature.  I had commented out a section from my previous post which I have now added back (latest code below).  But it still did not resolve the issue.
    When I execute with dismode = 'N', I get back error message "No batch input data for screen SAPLCZDI 1010".
    When I execute with dismode = 'E' (only show dynpros when error), it stops at the material selection screen without placing my cursor in the list.  I can then MANUALLY click to set the cursor position in the list, MANUALLY click the trashcan, it then uses my BDC command to respond to the popup asking "Do you want to delete", still leaving me at the material selection screen.  I can then MANUALLY click the green check (or enter), then it continues with the BDC to go back to the previous screen, and saves.  But it still will not place my cursor in the material selection list (SAPLCZDI screen 1010).
    Here is code used.  It is the second section of code labeled "CA02 Material Assignment - Delete" that is not working.
    CA02 Material Assignment - Set position
    this code functions to position the desired material to first in screen list
      PERFORM bdc_dynpro      USING 'SAPLCZDI' '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RC27X-ENTRY_ACT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ENT1'.
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'
                                     c_position.
    CA02 Material Assignment - Delete
      PERFORM bdc_dynpro      USING 'SAPLCZDI' '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR' 
                                    'MAPL-MATNR(01)'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=LOE'.             " trash can
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'
                                     c_position.
    Acknowledge Pop-Up Screen
      PERFORM bdc_dynpro      USING 'SAPLSPO1' '0100'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=YES'.
    CA02 Material Assignment - Green Check OK
      PERFORM bdc_dynpro      USING 'SAPLCZDI' '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RC27X-ENTRY_ACT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=BACK'.            " check mark
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'
                                     c_position.

  • Illustrator Short Commands Not Working

    Hi Team,
    My illustrator CS6 short commands have stopped working.
    Any time I try to use any CMD + Key, illustrator will not react.
    This has been on going for a few months, I have tried resetting preferences but nothing has changed.
    If someone could please help.
    Thanks,
    Brandon

    Hi Jacob,
    I have tried resetting preferences and few other options.
    Anytime I press the CMD key the option at the bottom just changes from selection to direct selection, if that helps.
    Should I uninstall and reinstall illustrator?
    I no longer have my access key.
    Thanks,
    Brandon
    Date: Wed, 8 Jan 2014 15:39:58 -0800
    From: [email protected]
    To: [email protected]
    Subject: Illustrator Short Commands Not Working
        Re: Illustrator Short Commands Not Working
        created by Jacob Bugge in Illustrator - View the full discussion
    THS,
    You may try the following (you have tried/done some of them already) and see whether it helps (the following is a general list of things you may try when the issue is not in a specific file; 3) and 4) are specifically aimed at possibly corrupt preferences):
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to 3 times);
    3) Close down Illy and press CtrlAltShift/CmdOptionShift during startup (easy but irreversible);
    4) Move the folder Other options (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall, run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
      http://www.adobe.com/support/contact/cscleanertool.html
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5994475#5994475
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5994475#5994475
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5994475#5994475. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Illustrator at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Application is not working due to memory issue

    Hi Friesnds,
    Kindly help me regarding settings in java. Scenario is like that. I have one server having two jboss versions (jboss-4.2.3 GA and jboss- 3.2.6). Each having java memory (JVM settings) 1 GB. The total memory of that server is 3 GB.
    Problem is that every two days my application is not working due to memory issue. Once i freed the memory (through run the commands - (1). sync
    (2). echo 3 > /proc/sys/vm/drop_caches
    Application works fine.
    I heared that the above command (echo 3 > /proc/sys/vm/drop_caches) can't run frequently because of server crash.
    Kindly help me regarding this issue and provide the resolution.
    Let me know if you need more information from my side.
    Thanks
    Ashish Shukla

    All of the above.  I tested on 4 different networks and had no luck, I also had friends test my network and the other networks with their iPhones and all had no issues using FaceTime.
    Also after I wiped my phone (erased all content and settings) I was able to successfully initiate a FaceTime call with no changes to my network and was also able to initiate another call when connected to another previously tested network that didn't work before.  Once I restored from backup though, FaceTime stopped working again.
    I did find this discussion: https://discussions.apple.com/thread/5163024?start=0&tstart=0
    and tried the suggestions found there too.  That discussion describes my issue I am having as well.

  • Bash commands not working after upgrade to Lion

    After upgrade, many BASH commands not working. For example, such a fundamental thing as "ls". 
    iMac20:bin a$ ls
    Launch of "ls" failed: the PowerPC architecture is no longer supported.
    What does it have to do with PowerPC? My computer is 2.66 GHz Inter Core Duo

    Linc,
    iMac20:~ a$ which ls
    /sw/bin/ls
    Also, I managed to look (using tcsh's ls-F command) into the contents of /usr/. Here's what I see there:
    [iMac20:/bin] a% ls-F
    [*          csh*        echo*       ksh*        mkdir*      rcp*        stty*       wait4path*
    bash*       date*       ed*         launchctl*  mv*         rm*         sync*       zsh*
    cat*        dd*         expr*       link*       pax*        rmdir*      tcsh*      
    chmod*      df*         hostname*   ln*         ps*         sh*         test*      
    cp*         domainname* kill*       ls*         pwd*        sleep*      unlink*    

  • Tx Data Sources NOT WORKING

    Is anyone else out there going crazy trying to get Tx Data Sources to work? out of the six connection pools I have, I can only get two of them setup with Tx Data Sources. I am able to make connections to the pools using DriverManager. However, when trying use them via a Data Source, only two of them work. This is the error:
    javax.naming.NameNotFoundException: Unable to resolve ACLINET1. Resolved: '' Unresolved:'ACLINET1' ; remaining name ''
    where ACLINET1 is the name of the pool and Data Source.
    ANy help would be great!

    Hi Mark,
    Could you check if a target is assigned to the datasources?
    Looks like it's not. Could you also show us the questionable
    code and the part of the config.xml defining pools and DataSources?
    Regards,
    Slava Imeshev
    "Mark GIlligan" <[email protected]> wrote in message
    news:3d1ce4c5$[email protected]..
    Is anyone else out there going crazy trying to get Tx Data Sources towork? out of the six connection pools I have, I can only get two of them
    setup with Tx Data Sources. I am able to make connections to the pools
    using DriverManager. However, when trying use them via a Data Source, only
    two of them work. This is the error:
    >
    javax.naming.NameNotFoundException: Unable to resolve ACLINET1. Resolved:'' Unresolved:'ACLINET1' ; remaining name ''
    >
    >
    where ACLINET1 is the name of the pool and Data Source.
    ANy help would be great!

  • Odi os command not working with agentservice agent.

    dear all,
    odi os command not working with agentservice agent but with local agent it work fine.. and user is administrator.
    kindly solve it
    Regards
    Naseer

    Hi,
    you referred to oscommand, so are you executing a .bat fille? if yes, where exactly does the .bat file reside, local machine or on network share?
    Also, follow these couple of documents, they may be helpful to you.
    859215.1 and 424703.1
    Regards
    Srikanth

  • Crontab reboot command not working

    Crontab reboot command not working
    Greetings
    I am new at this so excuse any ignorant mistakes I might be making.
    I have a server (MM X.4.9) that I would like to restart every day in order to make sure no programmes are hanging etc. If a program is hanging is should force quit it. Using terminal I have entered the following command:
    sudo nano /etc/crontab
    Entered password
    Than I entered using tab between each sequence:
    15 13 1 1 * root reboot
    This was a test run and it did not reboot.
    Entering
    cat /etc/crontab
    I got:
    # The periodic and atrun jobs have moved to launchd jobs
    # See /System/Library/LaunchDaemons
    # minute hour mday month wday who command
    15 13 1 1 * root reboot
    What have I done wrong?
    Thanks

    Hehe, there you are experimenting with a "reboot" cron command and you are surprised it quit so fast. You are not going to find a "graceful" solution to shutdown dialogs.
    MSWord is a Java app, so it is especially important for the command to work that it doesn't get hung up on outer layers of the system. Especially stupid apps that use Java which is not well integrated. I believe Word has a 5 minute autosave, so you should be able to recover most of your document.
    This reboot command should be running around 2AM, when the average webserver has minimum traffic. If you feel the need to reboot during busier times of the day, I'd suggest you look at what's causing your applications to crash.

  • My plugin is not working when "out-of-process plugins" ("OOPP") is enabled

    Plugin is working fine with FF3.0 but it is not working with FF4.0 and above. The reason I found out is in about:config dom.ipc.enabled is set to true. This means it whitelists the plugins to run in a plugin container.
    When I disabled the dom.ipc.plugins.enabled to false, I observed that plugin is working fine.
    I also tested by adding a separate entry dom.ipc.plugins.enabled.plugin.so to false and changed dom.ipc.plugins.enabled back to true. still it is working fine.
    This plugin is using NPAPIs.
    I couldn't figure out why the plugin behavior changes when it is running as a part of FF and running as a separate process.
    Thanks in advance for your help.

    Plugin is working fine with FF3.0 but it is not working with FF4.0 and above. The reason I found out is in about:config dom.ipc.enabled is set to true. This means it whitelists the plugins to run in a plugin container.
    When I disabled the dom.ipc.plugins.enabled to false, I observed that plugin is working fine.
    I also tested by adding a separate entry dom.ipc.plugins.enabled.plugin.so to false and changed dom.ipc.plugins.enabled back to true. still it is working fine.
    This plugin is using NPAPIs.
    I couldn't figure out why the plugin behavior changes when it is running as a part of FF and running as a separate process.
    Thanks in advance for your help.

  • Why my i pod is not working with out charger

    hey, my i pod is not working with out the charger plugged into it?!

    What do you mean? Please be more precised so I may help you father. If it is plugged in, but won't open. You must wait at least 5 minutes before using it again. Ipod need a certain amount of power for it to start. Or even when its plugged in but wont charge, make sure it is connected very well to the computer or the power outlet to the Ipod. Lastly, if you are charging at another place, for example in your friend's house. The voltage power may be different from where you mostly charge it from. But if it isn't plugged. Maybe it need to be charged?
    Hope this helps.
    ~pnoypryde

Maybe you are looking for