w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How start & stop MAMP PRO using command line?
As of at least MAMP 3.0.6, the following works for both Free and Pro versions: Open MAMP Pro or Free, depending on the one you use: Pro: open /Applications/MAMP PRO/MAMP PRO.app/ Free: open /Applications/MAMP/MAMP.app/ Then, cd into MAMP/bin: cd /Applications/MAMP/bin To start Apache & MySQL: ./start.sh To stop Apache & MySQL: ./stop.sh Note that you might need to sudo the commands above.

Categories : Osx

Stop bash script without command line
I think it is a little bit overcomplicated. Actually you do not need to start bash as it is started when You start ./executeServer.sh. Add executable rights to ./executeServer.sh and start it as it is. And do not need to start it in the background, as it already starts Server in the background in the script.

Categories : Bash

What is best way to start and stop hadoop ecosystem, with command line?
From Hadoop page, start-all.sh This will startup a Namenode, Datanode, Jobtracker and a Tasktracker on your machine. start-dfs.sh This will bring up HDFS with the Namenode running on the machine you ran the command on. On such a machine you would need start-mapred.sh to separately start the job tracker start-all.sh/stop-all.sh has to be run on the master node You would use start-all.sh on a single node cluster (i.e. where you would have all the services on the same node.The namenode is also the datanode and is the master node). In multi-node setup, You will use start-all.sh on the master node and would start what is necessary on the slaves as well. Alternatively, Use start-dfs.sh on the node you want the Namenode to run on. This will bring up HDFS with the Namenode running on

Categories : Hadoop

What does the ( ' > ) symbol mean in the command line in MySQL?
It means that it is treating any input which follows as part of a string literal, until it encounters a(n unescaped) string termination quote ' character. This will have happened because you previously began the string literal with such a string termination quote character. For example: mysql> SELECT foo -> FROM tbl -> WHERE bar LIKE 'somestring '> this is still part of somestring' -> ;

Categories : Mysql

How to import an SQL file using the command line in MySQL?
Try: mysql -u username -p database_name < file.sql Check MySQL Options. Note: It is better to use the full path of the SQL file file.sql.

Categories : Mysql

How do I set MySQL temporarily to read-only through the command line?
Well, if the user right now has all privileges first, you need to revoke it $>mysql -u DB_USER -pDB_PASS --execute="REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'YOUR_USER';" After that you give him, the select permission $>mysql -u DB_USER -pDB_PASS --execute="GRANT SELECT ON 'YOUR_DATABASE'@.* TO 'YOUR_USER'@'%';FLUSH PRIVILEGES;" Do your stuff and after that grant privileges again to the user $>mysql -u DB_USER -pDB_PASS --execute="GRANT ALL ON 'YOUR_DATABASE'@.* TO 'YOUR_USER'@'%';FLUSH PRIVILEGES;" And that's all folks NOTE: Review for quotation, perhaps i forgot something

Categories : Mysql

Use mysql command line interface with memcached
Memcached has its own protocol. The MySQL client cannot connect directly to a memcached server. You may be thinking of the MySQL 5.6 feature that allows MySQL server to respond to connections using a memcached-compatible protocol, and read and write directly to InnoDB tables. See http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached.html But this does not allow MySQL clients to connect to memcached -- it's the opposite, allowing memcached clients to connect to mysqld. Re your comment: The InnoDB memcached interface is not really a caching solution per se, it's a solution for using a familiar key/value API for persistent data in InnoDB tables. InnoDB does do transparent caching of data pages in its buffer pool, but this is no different from conventional data reads with SQL. Inno

Categories : Mysql

Does anyone use command line exclusively for managing mysql DB?
You can use G at the end of your query to display table columns as rows and make it easier to see the result set mysql> select * from users; +---------+---------+-----------------------+------------------+------------------------------------------+---------------------+ | id_user | name | email | salt | hash | created_at | +---------+---------+-----------------------+------------------+------------------------------------------+---------------------+ | ... | ... | ... | ... | ... | ... | ... X row in set (0.00 sec) mysql> select * from usersG *************************** 1. row *************************** id_user:

Categories : Mysql

mysql command line connection to azure
Key points: -p thepass using password: NO As per the docs: --password[=password], -p[password] The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, mysql prompts for one. So you're asked for a password, but you apparently didn't type anything at the Enter password: prompt. Thus the error.

Categories : Mysql

mysql command line to vertical output
I'm not sure this is a good solution, but if explicitly using egrep is annoying, you could define a shell function to launch mysql with the desired pager. Assuming you're using a bash (or compatible): # define a shell function to launch mysql with the required _pager_ sh$ mysql() { `which mysql` $* --pager="egrep -v '^*.**$'" ; } [ ... ] # launch mysql "as usual" (in reality, this is the shell function that is invoked) sh$ mysql -u user -p -h mysql-host mydb Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 67 Server version: 5.1.49-3 (Debian) -- Use mysql normally -- but the "egrep pager" will remove the "star lines" mysql> select * from TG col1: w col2: x col3: 0.4 1 row in set (0.00 sec) As I said before, this is not a perfect

Categories : Mysql

What is the method for clearing the screen on mysql command line?
Solution 1 system clear Solution 2 ! clear Solution 3 /c Not possible on Windows: See this link from SuperUser: http://superuser.com/questions/196806/is-there-a-command-to-clear-the-screen-of-mysql-under-windows

Categories : Mysql

How to make MySQL command line works with MAMP?
The MAMP mysql socket is located elsewhere. If you installed MAMP and own mysql parallel, you have two instances. One with MAMP context, which has its binary in /Applications/MAMP/Library/bin/ Other one depending on your settings during install. Make sure to start mysql (the one you would like to work with). You might want to use command line as follows: /Applications/MAMP/Library/bin/mysql [command goes here] To access the MAMP mysql server.

Categories : Mysql

Flyway command line filesystem migrations from actual command line input
flyway.cmd -configFile=/path/to/other/configFile.conf should do what you want. I just checked and it seems I forgot to document this on the website (It is in the usage description of the tool itself). Could you file an issue against the website, requesting this to be added?

Categories : Windows

How to find the mysql data directory from command line in windows
You can issue the following query from the command line: mysql -uUSER -p -e 'SHOW VARIABLES WHERE Variable_Name LIKE "%dir"' Output (on Linux): +---------------------------+----------------------------+ | Variable_name | Value | +---------------------------+----------------------------+ | basedir | /usr | | character_sets_dir | /usr/share/mysql/charsets/ | | datadir | /var/lib/mysql/ | | innodb_data_home_dir | | | innodb_log_group_home_dir | ./ | | lc_messages_dir | /usr/share/mysql/ | | plugin_dir | /usr/lib/mysql/plugin/ | | slave_load_tmpdir | /tmp | | t

Categories : Mysql

Formatting input from excel to mysql using command line client
seems u have used '|' in your csv file as delimiters instead of comma, try the code as `LOAD DATA LOCAL INFILE 'path to file.csv' INTO TABLE table_name FIELDS TERMINATED BY '|'LINES TERMINATED BY ' ';`

Categories : Mysql

ACCESS DENIED to mysql DB with PHP but can login with phpmyadmin and on the command line
The user you're going to use with your scripting should have both the "@localhost" and "'@%'" - Have a peek at the man. http://dev.mysql.com/doc/refman/5.1/en/adding-users.html This gave me a headache once.

Categories : PHP

How to get a tree-like output of mysql select queries on command line?
You are referring to the G option, the vertical mode or according to mysql help the ego mode. mysql> SELECT * FROM posts LIMIT 1G To make it standard behaviour add the following to your .my.cnf: [client] vertical

Categories : Mysql

How can I execute mysql query from command line on Server 2008 R2?
Usually the mysql command-line tool will get you there, where you may need to provide any credentials to get access. This comes with most installations of MySQL, but you'll need to check that it's located in your PATH or it might not be found. It may be easier to use the MySQL Workbench tool to connect and run queries instead.

Categories : Mysql

Executing mysql from command line just listing overview of arguments/variables
As documented under mysql Options (emphasis added): --password[=password], -p[password] The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, mysql prompts for one. Specifying a password on the command line should be considered insecure. See Section 6.1.2.1, “End-User Guidelines for Password Security”. You can use an option file to avoid giving the password on the command line.

Categories : Mysql

Android ADB stop application command like "force-stop" for non rooted device
The first way Needs root Use kill: adb shell ps => Will list all running processes on the device and their process ids adb shell kill <PID> => Instead of <PID> use process id of your application The second way In Eclipse open DDMS perspective. In Devices view you will find all running processes. Choose the process and click on Stop. The third way It will kill only background process of an application. adb shell am kill [options] <PACKAGE> => Kill all processes associated with (the app's package name). This command kills only processes that are safe to kill and that will not impact the user experience. Options are: --user | all | current: Specify user whose processes to kill; all users if not specified. The fourth way Needs root adb shell pm disable <PACKAGE&g

Categories : Android

Rails 3 active record observer not working when updating through MySQL command line/workbench
When you bypass activerecord by modifying the database directly, you naturally bypass all of the activerecord callbacks. So the answer is to update the data through the application, or to use database triggers instead.

Categories : Mysql

Piping output from 1 command to other command in an adb shell command line
One way is to create a shell script containing the commands you want and then run the shell script. Since the Android root filesystem is not writeable at run time (usually, unless you have rooted your device and remount it), you can copy the file to the removable (or emulated) storage, for example /sdcard. Then run the script using the command adb shell sh /sdcard/your-script-name. Because each script runs in its own subshell, both of your commands will be executed in the same shell on the device (you can confirm it with ps).

Categories : Android

unix command line cut and remove new line, unwrap next line
This awk one liner can do it: $ awk '{if ($0 ~ /&$/) {getline a; print $0,a} else {print }}' file it gets the lines ending with & and joins them with the next one. Otherwise just prints the line. Test $ awk '{if ($0 ~ /&$/) {getline a; print $0,a} else {print }}' file A7233334 PALLETS 2 11.000 EACH 2331 Storm Supply 247.5000 2,722.50 2,722.50 4144 Gentro Sales 225.0000 2,475.00 2,475.00 5155 Wacca Outfit 225.0000 2,475.00 2,475.00 6661 Acme Warehouse & Fuller Supply 225.0000 2,475.00 2,475.00 1661 McHugh & Donaldson

Categories : Unix

Command works in command line but gives 'no such file or directory' in bash script
Remove the quotes around line 8. Like this: ./optAlg.exe "$inputFile" 500 2>&1 > "output/$outputFile" By placing quotes around the whole line you tell bash to execute a command which is called exactly ./optAlg.exe $inputFile 500 2>&1 > output/$outputFile and of course there is no such command. In reality you want to run ./optAlg.exe with parameters. Do not forget to place quotes around the variables because otherwise filenames that have whitespace characters are going to be passed as several arguments. Please read about arguments. And you can read about common pitfalls as well.

Categories : Bash

Always given command line before python fabric command is executed on remote
Interesting, I don't have such issue, your code works fine for me (up to adding env.key_filename and env.password) c:work>fab hello [x.x.x.x] Executing task 'hello' [x.x.x.x] run: touch hello.world Done. Disconnecting from x.x.x.x... done. I'm using Fabric 1.7.0 and Paramiko 1.11.0. Possibly it's a problem of the terminal on your server.

Categories : Python

Batch file/command to start a program through command line
I'll edit this if you respond to my comment but if you want to simply execute this command via a batch file (and you know nothing about batch files): Open a text editor (e.g.Notepad) Type in your command (e.g. c: andaotherfoldermyprogram.exe 10 20) Save the file as mybatchfile.cmd Double click the file (in Windows Explorer etc.)

Categories : Windows

How do I set a command-line flag when running a Symfony2 Command test?
disabling debug in the kernel You can initialize the kernel in your test's setUp() method with debug set to false. use SymfonyBundleFrameworkBundleTestWebTestCase; class YourCommandTest extends WebTestCase { public function setUp() { static::$kernel = static::createKernel(array('debug' => false)); static::$kernel->boot(); // ... } Have a look at WebTestCase->createKernel(). using enviroments If you don't want the debug output in your logs edit/create app/config/config_test.yml and edit ... monolog: handlers: file: type: stream level: debug # log-level ... ... to another log level that suits your needs. Then execute your command using the test environment with --env=test

Categories : PHP

Defining the command line arguments of a linux command in python
format is your friend: import os, sys if len(sys.argv) == 2: os.system("sudo rtcwake -m off -s {}".format(sys.argv[1])) else: print "usage: ..." so the seconds are command line parameters. Or, you can make it interactive: import os secs = raw_input() os.system("sudo rtcwake off -s {}".format(secs)) to verify that the user input is an integer: try: secs = int(secs) except: print 'usage: '

Categories : Python

How to get command-line equivalent of command entered in Task Scheduler
schtasks /query /? schtasks /create /? the first has an option to export to xml, the second one as an option to import from xml. If you have only one or a few tasks to schedule, I would create them "the hard way" with schtasks /create

Categories : Windows

php sudo shell_exec command runs from command line, but not from browser
Would it be out of the question to make a shell script that would run your command? #!/bin/sh sudo whoami in the php: $retVal = `/path/to/custom/script/myscript.sh &2>1`; if ($retVal) echo 'SWEET'; else echo 'POOP: ' . $retVal; {command} inside `` means the same as shell_exec('{command}') on a linux server. If I'm not way off base here your goal is to add users to your VPN (among other things perhaps) in which case you could pass command-line parameters for username/password/etc to your custom shell script. It's not exactly a pure shell_exec() answer to your question, but maybe you can run myscript.sh without doing sudo. Just basing this on the fact you said everything you tried worked in shell and path was set in echo $PATH, but not sudo echo $PATH in your PHP script. Seem

Categories : PHP

PHP exec command works in shell and php command line but not on website
You can add the second parameter to help debug, $output will display what the cp command is doing, whether it be an error or not. I would also recommend placing quotes around the files, just in case something with a space gets in there. $src = "/mnt/..."; $dest = "/var/www/..."; exec("cp '$src' '$dest'", $output, $retrun_var); var_dump($output, $retrun_var);

Categories : PHP

different order of command line options in a command affecting my output
getoptlong() is doing exactly what it is supposed to do. The format-string "d:g:hv" implies that the parameters d and g require a value. Anything specified following a command-line parameter is consider a value being passed to it. You should run your program as $program --download file --version Checkout this detailed example demonstrating the various aspects of using getoptlong(). How rm can handle the differing position of its cmd-line params? Apparently because rm's parameters (r, v etc.) do NOT accept any values as arguments. Thus directory does not get passed to any of them but rather is a separate cmd-line argument on its own. You can confirm this from the source-code of rm. To do something similar for your program, you will need to modify the optstring to "dghv" a

Categories : C

How to issue a command from the command line of a process running on Linux
If you don't mind waiting for the calls to finish (one at a time) before returning control to your program, you can use the subprocess library. If you want to start something running and not wait for it to finish, you can use the multiprocessing library.

Categories : Python

How Can Be Used the Command Line of Developer Command Prompt in Vim on Windows?
You need to setup your PATH, INCLUDE and LIB environment variables. You could do that by running D:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat (or wherever it is located on your installation) in the same prompt you're running vim, or even manually setting these environment variables (here is a list of all values for VS2008 and Windows SDK: Using Visual Studio's 'cl' from a normal command line). However, you just can't run the bat file from vim directly, because it will open another Prompt, so the environment variables will be set only for that new prompt. The other option is just to create bat file which you can put it inside your PATH, for example cvim: call "D:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat" "C:Program Files (x86)Vimvim74g

Categories : C++

Remote command execution from command line in Windows XP
Maybe you could do that via Windows Scripting Host (WSH) which supported remote execution. See Setting up Remote WSH. The article contains a link to examples. (You may need to use the WshShell object to invoke taskkill from your remote script.)

Categories : Windows

Trouble running android command in command line
What Am I missing? You are missing two ~ characters, perhaps. The exact path is /Users/me/Development/adt-bundle/ That's not what you typed into your PATH. Your PATH says that there is no /Users/me -- instead, PATH is expecting a /Development directory in the root of your volume. Now, in Linux, the solution would be to add a ~ to indicate that /Development is relative to your home directory: export PATH=${PATH}:~/Development/adt-bundle/sdk/platform-tools:~/Development/adt-bundle/sdk/tools My OS X shell experience is rusty, so I forget if ~ will map to /Users/me or not. If it does, use ~, otherwise, go with: export PATH=${PATH}:/Users/me/Development/adt-bundle/sdk/platform-tools:/Users/me/Development/adt-bundle/sdk/tools

Categories : Android

Is there a command I can use to sign my modified apk on the command line in Linux?
For this you use standard Java SE tools: jarsigner and keytool. From Android documentation on signing: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name Remember that you should first sign and then align.

Categories : Android

how to read multiline output command line by line, in a shell script?
Maybe I found a different solution, where I can use variables also outside the loop I have to change the default IFS to newline echo Searching for android virtual devices ... IFS=$' '; for l in $(${PROGDIR}/android list avd) ; do VAR1=$(echo $l | cut -d: -f1 | sed -e 's/s*//'); #sed removes trailing blanks if [ $VAR1 == "Name" ]; then NUM_AVD=$(($NUM_AVD+1)); fi; done echo "NUM_AVD=$NUM_AVD" In this case NUM_AVD is correctly 2

Categories : Shell

Reading input files by line using read command in shell scripting skips last line
DONE=false until $DONE do read line || DONE=true echo $line done < blah.txt How to use `while read` (Bash) to read the last line in a file if there’s no newline at the end of the file?

Categories : Bash

How to get command line output snippet if I know the line number in Windows?
Here's one way of doing it with a batch file, although it's not a very elegant solution. @echo off setlocal set currentservice="" set servicestate="" sc query state= all > services.txt for /f "delims=:; tokens=1,2" %%a in (services.txt) do call :findservice "%%a" "%%b" del services.txt echo %servicestate% endlocal goto :end :findservice if not %1 == "SERVICE_NAME" goto :findstate set currentservice=%2 goto :end :findstate if not %1 == " STATE " goto :end if not %currentservice% == " Telnet" goto :end set servicestate=%2 goto :end :end It first writes out the result of the sc query to a temporary file (services.txt). It then uses a for loop to process each line of that file. When it find a line starting with SERVICE_NAME, it saves the value of that name in t

Categories : Windows



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.