Search Results

Search found 28350 results on 1134 pages for 'command switch'.

Page 32/1134 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Run a command as cron would but from the command line.

    - by BCS
    I have a script that I'm trying to run from cron. When I run it from bash, it work just fine. However when I let cron do it's thing, I get a: myscript.sh: line 122: syntax error: unexpected end of file What I want is a way to run a command as if it was a cron job, but do it in my shell. As a side note: does anyone know what would be differnt under cron? (the script already has a #!/bin/sh line) To answer my own question: I added this to my crontab: * * * * * bcs for ((i=1; i <= 55; i++)) ; do find ~/.crontemp/ -name '*.run' -exec "{}" ";" ; sleep 1; done` and created this script: #!/bin/sh tmp=$(mktemp ~/.crontemp/cron.XXXXX) mknod $tmp.pipe p mv $tmp $tmp.pre echo $* '>' $tmp.pipe '1>&2' >> $tmp.pre echo rm $tmp.run >> $tmp.pre chmod 700 $tmp.pre mv $tmp.pre $tmp.run cat $tmp.pipe rm $tmp.pipe With that, I can run an arbitrary command with a delay of not more than one second. (And yes, I know there are all kinds of security issue involved in that)

    Read the article

  • What is the preferred way to indent cases in a switch?

    - by neutrino
    Hey there, As I was writing another switch in Eclipse, I once again came across a rather weird (to me, at least) default indentation, which is applied to 'switch' statements: switch (i) { case 1: ... case n: ... } I tend to prefer another way: switch (i) { case 1: ... case n: ... } Which way is more readable and eye-pleasing for you? I'm still not hundred percent determined what's best for me, so I'd like to stick to what's best for other people who would read my code. BTW, you're free to close this question if this is too subjective. :)

    Read the article

  • Is it a good idea to define a variable in a local block for a case of a switch statement?

    - by Paperflyer
    I have a rather long switch-case statement. Some of the cases are really short and trivial. A few are longer and need some variables that are never used anywhere else, like this: switch (action) { case kSimpleAction: // Do something simple break; case kComplexAction: { int specialVariable = 5; // Do something complex with specialVariable } break; } The alternative would be to declare that variable before going into the switch like this: int specialVariable = 5; switch (action) { case kSimpleAction: // Do something simple break; case kComplexAction: // Do something complex with specialVariable break; } This can get rather confusing since it is not clear to which case the variable belongs and it uses some unnecessary memory. However, I have never seen this usage anywhere else. Do you think it is a good idea to declare variables locally in a block for a single case?

    Read the article

  • Correct to check for a command line flag in bash

    - by BCS
    In the middle of a scrip, I want to check if a given flag was passed on the command line. The following does what I want but seems ugly: if echo $* | grep -e "--flag" -q then echo ">>>> Running with flag" else echo ">>>> Running without flag" fi Is there a better way? Note: I explicitly don't want to list all the flags in a switch/getopt. (And BTW the bodies of the if just set a set of vars)

    Read the article

  • MacVim, Command-T: SEGV

    - by Ramon Tayag
    Details: OSX 10.7.4 I installed the latest MacVim via Homebrew: $ command-t brew install macvim ==> Downloading https://github.com/b4winckler/macvim/tarball/snapshot-64 Already downloaded: /Library/Caches/Homebrew/macvim-7.3-64.tgz ==> ./configure --with-features=huge --with-tlib=ncurses --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-t ==> make getenvy ==> make ==> Caveats MacVim.app installed to: /usr/local/Cellar/macvim/7.3-64 To link the application to a normal Mac OS X location: brew linkapps or: ln -s /usr/local/Cellar/macvim/7.3-64/MacVim.app /Applications ==> Summary /usr/local/Cellar/macvim/7.3-64: 1733 files, 27M, built in 53 seconds $ command-t brew linkapps Linking /usr/local/Cellar/macvim/7.3-64/MacVim.app Finished linking. Find the links under ~/Applications. $ command-t ruby -v ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0] $ command-t rvm list rvm rubies ree-1.8.7-2012.02 [ i686 ] ruby-1.8.7-p358 [ i686 ] ruby-1.9.2-p290 [ x86_64 ] ruby-1.9.2-p320 [ x86_64 ] ruby-1.9.3-p194 [ x86_64 ] # Default ruby not set. Try 'rvm alias create default <ruby>'. # => - current # =* - current && default # * - default $ command-t cd ~/.vim/bundle/vim-command-t/ruby/command-t ruby extconf.rb $ command-t ruby extconf.rb checking for ruby.h... yes creating Makefile $ command-t make cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o ext.bundle ext.o match.o matcher.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lpthread -ldl -lobjc ld: warning: ignoring file ext.o, file was built for unsupported file format which is not the architecture being linked (i386) ld: warning: ignoring file match.o, file was built for unsupported file format which is not the architecture being linked (i386) ld: warning: ignoring file matcher.o, file was built for unsupported file format which is not the architecture being linked (i386) $ command-t mvim MacVim then opens here. But when I open Command-T, MacVim crashes and I see this in the command line: $ command-t dyld: lazy symbol binding failed: Symbol not found: _rb_intern2 Referenced from: /Users/ramon/.vim/bundle/vim-command-t/ruby/command-t/ext.bundle Expected in: flat namespace dyld: Symbol not found: _rb_intern2 Referenced from: /Users/ramon/.vim/bundle/vim-command-t/ruby/command-t/ext.bundle Expected in: flat namespace Vim: Caught deadly signal TRAP Vim: Finished. The problem I have is very similar to this, except that I switched to the system Ruby and still got the error.

    Read the article

  • If a managed network switch were to overheat, would you consider it no longer reliable?

    - by Scott Szretter
    Here is the scenario - I have a network switch, one of several in a stack. It's fan failed. Soon, there were reports of users with network issues. After quickly replacing the fan, the users were fine, network issues were resolved. I assume the unit was overheating, and thus failing somehow. Today someone suggested to me, that I should not assume the unit is 100% reliable anymore. So what do you think, would an overheat condition (less than 1 day with the fan stopped) potentially cause permanent damage that could at some point come to the surface as future network failures/issues? If it matters, we are talking managed switches such as 3Com/HP SuperStack , ProCurve or PWR-Plus.

    Read the article

  • Full speed internal switch bandwidth but per-port set external bandwidth?

    - by garg
    I am in an environment where all the machines are behind a switch that I don't have access to. Each ethernet wall port has limited bandwidth depending on how much has been paid for each port. The problem is that some people have 10Mbps connections and some have 100Mbps connections and this causes problems with local intranet file transfers and operating system/software deployments. Operating systems can take hours to be deployed if the machine is on 10mbps. Do you know if it is possible with most switches to set a rule that would limit bandwidth coming in/going out to an extranet, but keep full bandwidth if the packets are destined to go to a local machine? For example, the internet might be limited to 10Mbps, but internal servers would get gigabit speeds? Thanks

    Read the article

  • Lock screen does not display all users (ubuntu 14.10)

    - by Ali Alwan
    When I lock my screen using ctrl+alt+L, I am not able to see other users listed within the lock screen so I can switch instead. The lock screen shows only my name as an option for login, however I would like to switch to other user accounts. In Ubuntu 12.04 it used to show all system available users in lock screen and I was able to switch easily. Last night I upgraded to Ubuntu 14.04 and this option is gone. How do I set back this option?

    Read the article

  • VLAN trunking between Juniper EX -> Cisco Catalyst -> and Cisco Router

    - by Hugo Garcia
    I have the following scenario: EX2200 Switch whit ge-0/0/6 set as an access port on VLAN 80 ge-0/0/0 set as a trunk port connected to a catalyst switch and various vlans allowed to pass includin vlan 80 On the Catalyst Switch. port #3 set up as a trunk port that receives traffic from the EX switch. port 46 is set up also as a trunk port that connects to a cisco router. Port #48 is where the host used to be connected host - EX2200 - Catalyst - Router the problem is that this EX2200 is a new addition to the network and the host connected previosly to the catalyst switch. traffic is not getting from the host to the router, but the router can send ARP request to the host. following is the relevant configuration: Catalyst Switch: interface GigabitEthernet1/46 switchport trunk encapsulation dot1q switchport trunk allowed vlan 80,82,83,93,289 switchport mode trunk mtu 1532 media-type rj45 speed 1000 duplex full arp timeout 300 ! interface GigabitEthernet1/48 switchport access vlan 80 switchport mode access mtu 1532 media-type rj45 speed 100 duplex full arp timeout 300 no cdp enable ! EX2200 Switch:

    Read the article

  • How To Switch Webmail Providers Without Losing All Your Email

    - by Chris Hoffman
    Do you use a webmail service you’re unhappy with because it’s where all your email is? There’s good news – you can easily switch, without losing your old email and contacts and without missing email sent to your old address. This guide will help you switch to a shiny new webmail service. The exact ways to switch between email services will differ depending on which webmail provider you’re using. We’ll be focusing on three of the most popular services here: Gmail, Outlook.com (Hotmail), and Yahoo! Mail. How To Switch Webmail Providers Without Losing All Your Email How To Force Windows Applications to Use a Specific CPU HTG Explains: Is UPnP a Security Risk?

    Read the article

  • vgaswitcheroo - switch GPU based on load?

    - by Primož Kralj
    Is it possible to make vgaswitcheroo switch between GPU based on load? For example, when computer would be in idle it would turn off discrete and use only integrated; when enough load would accumulate on it it would automatically turn on discrete graphics and disable integrated. My second question is whether there is any GUI applet or something that I could use to manually switch between GPUs - instead of manually echoing in switch file? Edit: I found answer to last question at https://help.ubuntu.com/community/HybridGraphics

    Read the article

  • How to switch off wifi on startup or from the console

    - by mit
    I have installed ubuntu 10.04 on a laptop. Wifi is switched on by default on startup. I can disable it rightclicking the network manager icon in the gnome bar. How can I set it to have wifi switched off as default? Alternatively, how can I switch off wifi on the console? I tried already the rfkill command but it does not list any devices and it does not switch off wifi, I tried different parameters. This is a standard install of the Ubuntu 10.04 i386 Desktop Live CD on an IBM T40 Laptop. EDIT A: This is the output of some rfkill commands on my system, and it does not affect the wifi of the laptop: $ rfkill --help Usage: rfkill [options] command Options: --version show version (0.4) Commands: help event list [IDENTIFIER] block IDENTIFIER unblock IDENTIFIER where IDENTIFIER is the index no. of an rfkill switch or one of: <idx> all wifi wlan bluetooth uwb ultrawideband wimax wwan gps fm $ rfkill list $ rfkill list wifi $ rfkill list all $ rfkill list wlan $ sudo rfkill list all $ sudo rfkill block all $ sudo rfkill block wlan $ sudo rfkill block wifi $ EDIT B: Now I found out that sudo ifconfig eth1 down turns it off. And I can turn it on through the gnome network applet again. But the applet does not reflect the change from the commandline, it stills believes wifi is switched on. I have to switch it off and on again on the applet to switch it on again, when I switched it off from the console. Is there a better way? This is what the syslog looks like when I switch wireless off and on again from the network manager: NetworkManager: <info> (eth1): device state change: 3 -> 2 (reason 0) NetworkManager: <info> (eth1): deactivating device (reason: 0). NetworkManager: <info> Policy set '24' (eth0) as default for routing and DNS. NetworkManager: <info> (eth1): taking down device. avahi-daemon[660]: Withdrawing address record for fe80::202:8aff:feba:d798 on eth1. kernel: [ 971.472116] airo(eth1): cmd:3 status:7f03 rsp0:0 rsp1:0 rsp2:0 NetworkManager: <info> (eth1): bringing up device. NetworkManager: <info> (eth1): supplicant interface state: starting -> ready NetworkManager: <info> (eth1): device state change: 2 -> 3 (reason 42) avahi-daemon[660]: Registering new address record for fe80::202:8aff:feba:d798 on eth1.*. kernel: [ 965.512048] eth1: no IPv6 routers present

    Read the article

  • What's required to enable communication between two IP ranges located behind one switch?

    - by Eric3
    Within our co-located networking closet, we have control over two ranges of 254 addresses, e.g. 64.123.45.0/24 and 65.234.56.0/24. The problem is, if a host has only one IP address, or a block of addresses in only one range, it can't contact any of the addresses in the other subnet. All of our hosts use our hosting provider's respective gateway, e.g. 64.123.45.1 or 65.234.56.1 A host on the 64.123.45.0/24 range can contact the 65.234.56.1 gateway and vice-versa Everything in our closet is connected to an HP ProCurve 2810 (a Layer 2-only switch), which connects through a Juniper NetScreen-25 firewall to the outside world What can I do to enable communication between the two ranges? Is there some settings I can change, or do I need better networking equipment?

    Read the article

  • Why do we have to use break in switch

    - by trejder
    Who decided, and basing on what concepts, that switch construction (in many languages) has to be, like it is? Why do we have to use break in each statement? Why do we have to write something like this: switch(a) { case 1: result = 'one'; break; case 2: result = 'two'; break; default: result = 'not determined'; break; } I've noticed this construction in PHP and JS, but there are probably many other languages that uses it. If switch is an alternative of if, why we can't use the same construction for switch, as for if? I.e.: switch(a) { case 1: { result = 'one'; } case 2: { result = 'two'; } default: { result = 'not determined'; } } It is said, that break prevents execution of a blocks following current one. But, does someone really run into situation, where there was any need for execution of current block and following ones? I didn't. For me, break is always there. In every block. In every code.

    Read the article

  • Have you considered switch from Windows to OS X?

    - by Oscar Reyes
    For several years I wanted to move from Windows to OSX. Mainly because back then Windows95/98/2000 were terrible options. Now I have finally put my hands on this. Just when Vista and Win7 seems to redeem all the mistakes from their predecessors. The most terrible rant is the lack of the following keys: PageUp, PageDown, Home, End, Supr Not having those made my first programming day terrible on OSX. I don't regret switching, but somehow I expected something else. So: Have you considered switch to mac? What has stopped you? What is holding you back? If you have switched already, are you willing to comeback? (Now I run XP/Vista/Ubuntu/OSX in the same machine, yeah!!)

    Read the article

  • Making a language switch main menu button in Drupal

    - by Let_Me_Be
    I have a bilingual site in Drupal. The problem is that I hate the language switch block taking up so much space (sometimes the only thing in the sidebar is the language switch block). So what I would love to have is language switch menu item, that would point to the other language (other then the current one). Something like this: | Home | Projects | BlaBla | | Cesky | after swith: | Domu | Projekty | Blabla | | English | Is that possible without writing a whole new module?

    Read the article

  • The Switch Workshop, by Red Gate and Re-Wired Group

    Customers don’t just buy a product — they switch from something else. And customers don’t just leave a product — they switch to something else. It’s in these switching moments that the deepest customer insights can be found. On the 25th of July, a select group of 32 people will attend a unique, hands-on, full-day workshop at Red Gate to learn about “The Switch”. ‘Disturbing Development’Grant Fritchey & the DBA Team present the latest installment of the Top 5 hard-earned lessons of a DBA – read it now

    Read the article

  • Open Source or Low Cost Layer 7 ("Content") Switch?

    - by Rob
    I have several web servers that host a number of different applications and web sites. I want to make it easy to host apps or parts of web sites on different servers (e.g. example.com/foo might be on one physical server and example.com/bar might be on another). We do this Apache redirects right now, but that gets messy fast and in any case we have other problems we want to solve, such as throttling requests from individual clients, and reducing dependency on specific physical hosts. Is there an open source or low cost layer 7 switch that would be suitable for this sort of task? I was hoping to find something like a stripped down Linux VMware guest/appliance built for this purpose, but haven't seen anything suitable out there so far.

    Read the article

  • Xcode "Build and Archive" from command line

    - by Dan Fabulich
    Xcode 3.2 provides an awesome new feature under the Build menu, "Build and Archive" which generates an .ipa file suitable for Ad Hoc distribution. You can also open the Organizer, go to "Archived Applications," and "Submit Application to iTunesConnect." Is there a way to use "Build and Archive" from the command line (as part of a build script)? I'd assume that xcodebuild would be involved somehow, but the man page doesn't seem to say anything about this.

    Read the article

  • add a start up item via command line (mac)

    - by adam n
    How can I add a start up item via command line on a mac? From googling, I know you have to edit ~/Library/Preferences/com.apple.loginitems.plist using defaults write com.apple.loginitems [key] [value] but i'm not sure exactly which things to edit.

    Read the article

  • How to handle crash from system command in Perl on windows

    - by Pete
    I am calling a command-line program from my perl script, when these programs crash, I am prompted with a messagebox asking me if I want to notify Microsoft. Since this is an automated system it would be desirable if I could suppress that message and continue with other things in my script. Is this possible?

    Read the article

  • how to start growl via the command line

    - by adam n
    I have a bash script that uses growlnotify to send notifications. However, growlnotify doesn't work if Growl isn't already running, and it won't auto start Growl if it needs it, either. So I want to be able to check if Growl is running, and then start it if it isn't. I'm thinking of doing something like: g=$(ps -e | grep Growl | grep -v grep) if [ -z "$g" ] # Growl isn't running then # (start Growl) fi How would I start Growl via the command line?

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >