Search Results

Search found 10355 results on 415 pages for 'shell extension'.

Page 14/415 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • How to execute a shell script on startup?

    - by vijay.shad
    I have create a script to start a server(my first question). Now I want it to run on the system boot and start the defined server. What should I do to get this done? My findings tell me put this file in /etc/init.d location and it will execute when the system will boot. But I am not able to understand how the first argument on the startup will be start? Is this predefined somewhere to use start as $1? If I want to have a case startall that will start all the servers in the script, then what are the options I can manage. My Script is like this: #!/bin/bash case "$1" in start) start ;; stop) stop ;; restart) $0 stop $0 start ;; *) echo "usage: $0 (start|stop|restart)" ;; esac

    Read the article

  • Retrieving a specific value from "df -h" using shell

    - by Diego Dias
    When I use df -h, I get the following output: Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 59G 2.2G 54G 4% / /dev/sda1 122M 38M 78M 33% /boot tmpfs 1.1G 0 1.1G 0% /dev/shm 10.10.0.105:/somepath 11T 8.4T 2.1T 81% /storage4 10.11.0.101:/somepath 15T 8.9T 5.9T 61% /storage1 /dev/mapper/patha 5.0T 255G 4.8T 5% /storage5_vol0 /dev/mapper/pathb 5.0T 195G 4.9T 4% /storage5_vol1 /dev/mapper/pathc 5.0T 608G 4.5T 12% /storage5_vol2 I want to write a script that gets the value of Avail column on a specific storage. I used to use df -k /storage_name | tail -1 | awk '{print $3}' But the FileSystem column can have a value or not .. which would change the variable of my script from $3 to $4. How can I get the Avail on a single command line even if there are no values on the previous columns?

    Read the article

  • linux shell utils: convert a list of hex to list of decimals

    - by osgx
    Hello How can I convert a file with a lot hex numbers into the decimal? Example: file1 0x59999 0x5acdc 0xffeff I want to start $ cat file1 | util | cat file2 and get file2 with smth like 1021489 1249230 3458080 (numbers in example output are random, as I cant convert so long hex to dec) Upd: perl : perl -pe '$_=hex;$_.="\n"'. Can anybody do it better? The real task is a sorting of hex numbers.

    Read the article

  • shell pipe behavior with MySQLDump

    - by unknown (google)
    I am using mysqldump for a large database (several GB) and import the result from a pipe, please see commands below, does it do incremental pipe, or wait until the first one finishes then import? is this a good way of importing large db across servers? I know you can export gz it, then pscp it then import. Quick alternative are welcome mysqldump -u root -ppass -q mydatabase | mysql -u root -ppass --host=xxx.xx.xxx.xx --port=3306 -C mydatabase

    Read the article

  • Shell script to fix bad filenames? [closed]

    - by Ze'ev
    I'm IT at my small firm; and, despite my dire warnings, everyone puts files on the server with awful names, including leading & trailing spaces, bad characters (including \ ; / + . < > - etc!) They do this by accessing the (FreeBSD/FreeNAS) server via AFP on Macs, so no part of the system complains. Is there a script I can use to go through an entire directory tree and fix bad filenames? Basically replace all spaces & bad ASCII with _ ... and if a file already exists, just slap a _2 or something on the end. I don't suppose there's a way to get the system to enforce good filenaming conventions, is there?

    Read the article

  • Is it possible to group chrome extension processes?

    - by Shajirr
    I have a problem with Chrome - most extensions, even those which consume merely 5-10 MB of memory, each have their own process, and because of that Chrome uses a single process for all the tabs, which consume a lot more memory compared to extensions, even with --proccess-per-tab switch. This behavior seemes illogical - why do you need extensions in separate processes if you can't use your browser properly when it takes 5-10 seconds just to load a tab and freezes constantly? Is it possible somehow to limit the number of processes which can be used for extensions, maybe group them to 10 extensions per 1 process?

    Read the article

  • Shell script to block proftp failled attempt

    - by Saif
    Hello, I want to filter and block failed attempt to access my proftp server. Here is an example line from the /var/log/secure file: Jan 2 18:38:25 server1 proftpd[17847]: spy1.XYZ.com (93.218.93.95[93.218.93.95]) - Maximum login attempts (3) exceeded There are several lines like this. I would like to block any attempts like this from any IP twice. Here's a script I'm trying to run to block those IPs. tail -1000 /var/log/secure | awk '/proftpd/ && /Maximum login/ { if (/attempts/) try[$7]++; else try[$11]++; } END { for (h in try) if (try[h] > 4) print h; }' | while read ip do /sbin/iptables -L -n | grep $ip > /dev/null if [ $? -eq 0 ] ; then # echo "already denied ip: [$ip]" ; true else logger -p authpriv.notice "*** Blocking ProFTPD attempt from: $ip" /sbin/iptables -I INPUT -s $ip -j DROP fi done how can I select the IP with "awk". with the current script it's selecting "(93.218.93.95[93.218.93.95])" this line completely. But i only want to select the IP.

    Read the article

  • why run a Linux shell command with &?

    - by George2
    I am using Red Hat Linux Enterprise version 5. Sometimes I notice people run command with a couple of & options. For example, in the below command, there are two &-signs. What are the function of them? Are they always used together with nohup? nohup foo.sh <parameters to specific the scripe> >& <log_file_name> & thanks in advance, George

    Read the article

  • How to avoid duplicates when copying files that have been renamed at the destination

    - by Benoitt
    I have to get pictures from a folder – with subfolders which are updated automatically – with their extensions. These files have to be copied in a folder where a website based on PHP will edit them (by renaming and creating an XML file) to be downloadable and integrated in an XML feed. Because of the rename function of the script, when I perform the copy gain, all the files are duplicated, because the script has renamed the original ones already. I've tried a few things with rsync but I'm looking for something more powerful because I can't copy files with an external "history". #!/bin/bash find '/home/name/picture' -name '*.jpg' | while read FILE ; do rsync --backup --backup-dir=incremental --suffix=.old "$FILE" /var/www/media ; done wget --spider 'http://myscript.php' ; #exit 0 PS: As a little addition, I'd like to replace '.' with a 'space' just after the *.jpeg copy. My PHP script has some problem to define files with comma because of the extension. I'm finking about a command with find – like I did before – with a sed function? Is that a good idea?

    Read the article

  • "Bootstrap" python script in the Windows shell without .py / .pyw associations

    - by PabloG
    Sometimes (in customer's PCs) I need a python script to execute in the Windows shell like a .CMD or .BAT, but without having the .py or .pyw extensions associated with PYTHON / PYTHONW. I came out with a pair of 'quick'n dirty' solutions: 1) """ e:\devtool\python\python.exe %0 :: or %PYTHONPATH%\python.exe goto eof: """ # Python test print "[works, but shows shell errors]" 2) @echo off for /f "skip=4 delims=xxx" %%l in (%0) do @echo %%l | e:\devtools\python\python.exe goto :eof ::---------- # Python test print "[works better, but is somewhat messy]" Do you know a better solution? (ie: more concise or elegant)

    Read the article

  • Which book for windows Shell programming?

    - by serefarikan
    I've been looking for a good book for windows shell programming, and the only one I could find is Visual C++ Windows Shell Programming by Dino Eposito: http://www.wintellect.com/BookInformation.aspx?ASIN=1861001843 It is an old book, and I'd like to know if you know of any good resources which could help. I need to develop a couple of windows explorer extensions, and apparently managed code is not recommended by Microsoft at least for some of these tasks. So I'm searching for a good resource for native development. Kind regards Seref

    Read the article

  • In a bash script echo shell commands

    - by user343547
    In a bash script how do I echo all shell commands called and expand any variable names? For example, given the following line: ls $DIRNAME I would like the script to run the command and display the following ls /full/path/to/some/dir The purpose is to save a log of all shell commands called and their arguments. Perhaps there is a better way of generating such a a log?

    Read the article

  • Fish Interactive Shell full path

    - by Milhous
    Is there a way in the Fish Interactive shell for the full path to be displayed. Currently when I navigate to a directory I get the following shell. millermj@Dodore ~/o/workspace but I would rather see millermj@Dodore ~/o-town/workspace

    Read the article

  • PHP extension wrapper for C++

    - by Yijinsei
    Hi guys, I am new in this area of writing extension for PHP, however I need to create a wrapper class for C++ to PHP. I am currently using PHP 5.2.13. I read this article http://devzone.zend.com/article/4486-Wrapping-C-Classes-in-a-PHP-Extension, a tutorial on how I could proceed to wrap C++ class to communicate with PHP Zend however it is written to for linux system. Do you guys have any article or advice on how I could proceed to write a wrapper class to communicate with PHP?

    Read the article

  • Stop execution of python script when parent Bash shell script is killed

    - by jrdioko
    I'm working on a Bash shell script that runs several Python scripts like so: cd ${SCRIPT_PATH} python -u ${SCRIPT_NAME} ${SCRIPT_ARGS} >> $JOBLOG 2>&1 At one point, I killed the shell script (using kill PID), but the Python script continued running, even after the script terminated. I thought these would die as soon as the main script died. What am I misunderstanding about Bash scripting, and what can I do to get the functionality I'm looking for? Thanks in advance!

    Read the article

  • Problem about Chrome Extension

    - by Gnu
    Hi! I try to write an extension and i saw the very restricted policy security. I should create an extension that allows me to listen and download podcast from web. It is possible? I use Chrome OS with VMWare, this OS has additional Api than Google Chrome Browser? Thanks

    Read the article

  • New Application Process from Bash Shell

    - by Thomas Uster
    I'm relearning UNIX commands to use git on windows using MINGW32. When I launch a program, for example "$ notepad hello.txt" I can't use the shell again until I close the notepad file or CTRL-C in the shell. How do I essentially fork a new process so I can use both programs?

    Read the article

  • Pass variables to current tab via chrome extension

    - by iamthejeff
    I am writing my first chrome extension, and I want to pass a variable to the currently opened tab and manipulate the DOM with it. My extension has a button, and when clicked, is executing this code: chrome.tabs.getSelected(null, function(tab) { chrome.tabs.executeScript(tab.id, { file: 'tabscript.js' }); }); This works fine, but I see no way to pass a variable to tabscript.js so it can be used on the opened tab.

    Read the article

  • In an extension method how do a create an object based on the implementation class

    - by Greg
    Hi, In an extension method how do a create an object based on the implementation class. So in the code below I wanted to add an "AddRelationship" extension method, however I'm not sure how within the extension method I can create an Relationship object? i.e. don't want to tie the extension method to this particular implementation of relationship public static class TopologyExtns { public static void AddNode<T>(this ITopology<T> topIf, INode<T> node) { topIf.Nodes.Add(node.Key, node); } public static INode<T> FindNode<T>(this ITopology<T> topIf, T searchKey) { return topIf.Nodes[searchKey]; } public static bool AddRelationship<T>(this ITopology<T> topIf, INode<T> parentNode, INode<T> childNode) { var rel = new RelationshipImp(); // ** How do I create an object from teh implementation // Add nodes to Relationship // Add relationships to Nodes } } public interface ITopology<T> { //List<INode> Nodes { get; set; } Dictionary<T, INode<T> > Nodes { get; set; } } public interface INode<T> { // Properties List<IRelationship<T>> Relationships { get; set; } T Key { get; } } public interface IRelationship<T> { // Parameters INode<T> Parent { get; set; } INode<T> Child { get; set; } } namespace TopologyLibrary_Client { class RelationshipsImp : IRelationship<string> { public INode<string> Parent { get; set; } public INode<string> Child { get; set; } } } public class TopologyImp<T> : ITopology<T> { public Dictionary<T, INode<T>> Nodes { get; set; } public TopologyImp() { Nodes = new Dictionary<T, INode<T>>(); } } thanks

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >