w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to rename a MOUNT (mounted shared folder from Windows named mnt)
Follow these steps: Unmount: umount /mnt Create another folder /my_new_mount Mount again: mount -t cifs -o username=myusername,password=mypassword //10.80.50.50/Share /my_new_mount Update in /etc/fstab

Categories : Linux

Copying files on mounted drive
Neither cp nor the smb protocol are smart enough to realize that the source + destination of the file are on the same remote server. cp will simply do its usual thing and slurp all the data from the source file (copying it to the client machine), then spit it back out in the target file on the server. So yes, it'll be a round-trip through the client. A better solution for this sort of thing is using an SSH remote command, turning it into a purely server-side operation: ssh imageuser@x.x.x.x 'cp sourcefile targetfile' You can still keep the fileserver mounted on your local machine to actually see what files you're dealing with, but do all the file copy/move operations via the ssh commands for efficiency. Since the server is a Windows machine, you'll probably have to install cygwin and g

Categories : PHP

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

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

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 get access after hide the drive with Diskpart Command-Line Utility
You can use the volume GUID like this: \?Volume{2a0b16cf-f76a-11df-9310-806e6f6e6963}pathfile.ext Note that only the Unicode file functions will accept this sort of path, and the syntax has to be strictly correct. For example, you can't use forward slashes instead of backslashes. I'm not sure how best to enumerate the volume GUIDs. One method is QueryDosDevice but I expect there are better ways.

Categories : C

Compile Adobe Flash Builder project with Flex SDK command line
mxmlc.exe is used to compile the application, compc.exe is used to compile libraries. If you have code library dependencies, you'll first need to compile these and then compile your application. The documentation on compiling is pretty good and can be found here: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fcc.html I would suggest you give this a go and post specific questions if you run into issues.

Categories : Eclipse

Edit Google spreadsheet automatically from command line
Finally I found how to do it looking to Python code of googlecl. What you need is to build a script that do the following: #!/bin/bash -l #$ -S /bin/bash #S -N $1 export GOOGLE_DOC=$1 #!Then do whahever you need to do with the google file This script is just taking the value of the first argument (which will be the path to the google doc that you want to edit by doing whatever with it). Then all what you need is to call to googlecl like this: google docs edit --title GOOGLE_DOC_TITLE --format FORMAT --editor SCRIPT_WE_JUST_BUILD GoogleCl is creating a temporary file in your system and is passing to the editor(our script) the path to that temporary file. So what we are getting is the path to the temporary file. Whenever yoy finish googlecl will look if there is any change in that fil

Categories : IOS

Detecting mounted drives on Linux and Mac OS X
As far as the filesystem is concerned, there is no concept of drives in Unix/Linux (I can't vouch for MacOSX but I'd say it's the same). The closest thing would probably be mount points, but a normal application shouldn't bother about them since all is already available under the filesystem root / (hence the behaviour of QDir::drives() that you observe). If you really want to see which mount points are in use, you could parse the output of the mount command (without any arguments) or, at least on Linux, the contents of the /etc/mtab file. Beware though, mount points can get pretty hairy real quick (loop devices, FUSE filesystems, network shares, ...) so, again, I wouldn't recommend making use of them unless your application is designed to administer them. Keep in mind that on Unix-y OSes

Categories : C++

Automatically fill command line input of variable size
yes $'a b' | script.py Uses bash's $'...' syntax for string literals which contain escape sequences. Alternatively: while true; do echo a; echo b; done | script.py

Categories : Python

Using Bluetooth low energy in linux command line
I used to broadcast BT services by following this article. This page not only shouws you how to advertise a profile, but also gives you an example on how to implement the HSP profile. To know the bt class you need to announce, you can check this other page.

Categories : Linux

How can I do a yum install in a linux command line from a jar file?
Try this : public class test { public static void main(String[] args) { Runtime rt = Runtime.getRuntime(); String cmd[] = new String[] {"yum", "-y", "install", "rpm-build"}; Process ps = rt.exec(cmd); BufferedReader readerStd = new BufferedReader(new InputStreamReader(ps.getInputStream())); BufferedReader readerErr = new BufferedReader(new InputStreamReader(ps.getInputStream())); String line = null; while ((line = readerStd.readLine()) != null) { System.out.println(line); } System.out.println("------ Std Err -------"); while ((line = readerErr.readLine()) != null) { System.out.println(line); } if (ps.waitFor()==0) { System.out.pr

Categories : Java

Executing Linux-CentOS Command Line via PHP codings
Check your php.ini. The exec command probably is given in the disable_functions string. Remove it from this option. If it is forbidden by safe_mode you probably can turn it on by: php_admin_value safe_mode off in your webserverconfig (httpd.conf) For both methods reload/restart your apache/web-server to load the new configuration.

Categories : PHP

Linux -- How to cut a column from one file and paste into another in a one-line command?
If you can live with a tab separator (or another single character) you can do cut [column-spec] file1 | paste file2 - > file3 The - in the paste command reads stdin, which of course contains the lines produced by cut. There's no matching on values, this is a straight line-for-line copy and paste.

Categories : Linux

how can execute nagios commands from command line in linux
You actually have the answer in your config - just execute in shell: /usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com You may add -v for verbose output. Nagios is only a scheduler and executes commands at specified intervals. Then reports the state based on response.

Categories : Linux

joining a multicast group in linux using a command line
You could use ssmping. Just specify a regular unicast address and it will try to join the fixed multicast address 232.43.211.234 by sending periodic membership reports.. Not that you have to keep this application running or your multicast membership will time out.

Categories : Linux

Can I create new S3 users and add IAM policies from the Linux command line?
I have no experience of using it myself, but I found a tool for interacting with Amazon IAM, the access control service for AWS, in a manner that might work for you: IAM Command Line Toolkit (note: last updated September 2010) There may be more usable stuff under the IAM Resources section. If you are unfamiliar with IAM, the documentation is one place to start. Although, knowing the general style of AWS documentation, there may be better resources and tutorials to be found elsewhere.

Categories : Amazon

Linux XML Editing from Command Line / Shell Script
I wouldn't try to use sed to edit XML. Unless there is some constant to match on (that lets you decide if you are on a /1 or /2) it'll be hard (I would say impossible, but some sed guru will chime and and prove me wrong...) If you can't install stuff, something like an awk or perl script that lets you keep a minimum of state you work better than sed.

Categories : Xml

Missing something in the linux terminal after launching matlab from the command line
The problem is not with dlmwrite. This seems to be a bug in some versions of MATLAB, as reported in this link. The proposed solution (if you have a buggy version of MATLAB) is to use nohup: nohup matlab -nodesktop -nosplash -r ........... UPDATE: Per @Amro 's suggestion, @pQB reported the problem to MathWorks Support. Their response was: The problem is a known issue in versions prior to R2012a. Run MATLAB under a different shell. For example, neither tcsh or zsh have this issue. OLD answer: The problem is not with dlmwrite, but with the the content of your matrix. Furthermore, unless file_name points to stdout (e.g., file_name='/dev/stdout';), the dlmwrite function will not write anything to screen and will not mess your terminal. Either file_name points to stdout or you are dis

Categories : Linux

How can I dump and decrypt HTTPS traffic from the command line under linux?
You can use ssldump.(it works on top of libpcap). ssldump -r <File_Name>.pcap -k <Key_File>.key -d host <IP_Address> You specify the following options with the ssldump utility: -r: Read data from the <File_Name>.pcap file instead of from the network. -k: Use <Key_File>.key file as the location for the SSL keyfile. -d: Display the application data traffic. You may refer the complete example here

Categories : Http

How to build OpenCV with Java under Linux using command line?(Gonna use it in MapReduce)
Probably what you're missing is ant, which is a java oriented build tool. When you go: cmake -D BUILD_SHARED_LIBS=OFF ../opencv-2.4.5/ (i.e. where you're configuring the make for your machine), check for the section that says java. It should say something like this (possibly with different paths/versions): -- Java: -- ant: /usr/bin/ant (ver 1.8.2) -- JNI: /usr/lib/jvm/java-6-openjdk/include /usr/lib/jvm/java-6-openjdk/include /usr/lib/jvm/java-6-openjdk/include -- Java tests: YES When I first ran cmake, I had this: -- Java: -- ant: NO -- JNI: NO -- Java tests: YES Which indicated it couldn't find ant, and so it didn't creat

Categories : Java

from Linux command line, find number of lines in which a string occurs
You're looking for the grep command. Here's a basic tutorial. It's extremely useful for string searching in files. It also has support for regular expressions. It looks like you'll do something like this: grep -c "mystring" /home/someuser/sometext.txt The -c argument is short for --count and tells grep to print out the number of lines that contain the string.

Categories : Linux

Ignoring errors and continuing to run when executing R script from command line Linux
Use try or tryCatch (the former is simpler and generally all you need). You're already using tryCatch later on, so use it to deal with your problematic query as well.

Categories : R

How can I list upnp server/renderer in command line (console mode) on linux?
gssdp-discover (from gupnp-tools) will list devices and services advertized over SSDP: gssdp-discover -i wlan0 --timeout=3 You can also specify the target (as uuid or a service/device type): gssdp-discover -i wlan0 --timeout=3 --target=urn:schemas-upnp-org:device:MediaRenderer:1

Categories : Linux

Concatenate / Join MP4 files using ffmpeg and windows command line batch NOT LINUX
From reading your question, I'd suggest that the configuration file might look like this: # this is a comment file 'C:UsersJoe1Maysession3 eadyforfinalconversionTitlefile.mp4' file 'C:UsersJoe1Maysession3 eadyforfinalconversionEnglishfile.mp4' It may need double quotes around the pathfilenames instead of single quotes, for Windows. Try it both ways.

Categories : Windows

Error while building linux kernel 3.8.11 - unrecognized command line option "-fstack-protector"
Figured it out. While configuring the kernel., Under Kernel Feature ---> Disabling "Enable -fstack-protector buffer overflow detection" fixed this problem. It was because my toolchain gcc 4.0.1 did not have -fstack-protection feature.

Categories : Gcc

Linux Shell Script: How to detect NFS Mount-point (or the Server) is dead?
"stat" command is a somewhat cleaner way: statresult=`stat /my/mountpoint 2>&1 | grep -i "stale"` if [ "${statresult}" != "" ]; then #result not empty: mountpoint is stale; remove it umount -f /my/mountpoint fi Additionally, you can use rpcinfo to detect whether the remote nfs share is available: rpcinfo -t remote.system.net nfs > /dev/null 2>&1 if [ $? -eq 0 ]; then echo Remote NFS share available. fi Added 2013-07-15T14:31:18-05:00: I looked into this further as I am also working on a script that needs to recognize stale mountpoints. Inspired by one of the replies to "Is there a good way to detect a stale NFS mount", I think the following may be the most reliable way to check for staleness of a specific mountpoint in bash: read -t1 < <(stat -t "/my/m

Categories : Linux

Where to put USB Flash Drive detection in WPF, MVVM
I would leave it in MainWindow.xaml.cs. If you need to overwrite WndProc it's tightly related anyway and it belongs to some "system interface" which normally doesn't belong to your view-model or model. Also, there's nothing wrong with using code behind. Well, it may be only a personal opinion.

Categories : C#

Python off a Flash Drive, how to start IDLE?
It can not be guaranteed this is possible unless you have high enough system privileges that you can change the global path. There is really no way around this on most computers that you do not own, which I imagine is the main purpose. In those cases when you have enough privileges (it is worth a try some systems still allow this for regular users but many others do not) you can use: setx PATH "%path%;yourpath" edit and ps: You can figure out the drive letter without input, if you know the disk label, with something like this: @echo off set label=DRIVENAME set cmd=WMIC logicaldisk WHERE volumename^^="%label%" GET caption FOR /F "tokens=1" %%G IN ('%cmd% ^| find ":"')DO set pydrive=%%G echo %pydrive%pathtopython rem do your stuff here the idle started inside the batch will inherit

Categories : Python

linux: running self compiled kernel in qemu: VFS: Unable to mount root fs on unknown wn-block(0,0)
maybe your system image file is bad and can not be mounted. You may try these command to mount the image file and check if it is a valid root file system for linux. losetup /dev/loop0 /var/lib/libvirt/images/Debian.img kpartx -av /dev/loop0 mount /dev/mapper/loop0p1 /mnt/tmp

Categories : Linux

I am trying to start an office program on a flash drive with a batch file
I think some of the directory names in %path% contain spaces and since %path% is not enclosed within ""( double quotes), the script is unable to find the exe . You may also want to include a log file so that it becomes easier to debug in case of any errors. Try this: set baseFolder=%~dp0 start "%baseFolder%office6wpp.exe" > "%baseFolder%batchRunLog.log"

Categories : Batch File

capture picture from linux command line (uvccapture captures black picture)
a bit of an odd suggestion, but have you tried using sudo uvccapture -S40 -C30 -G80 -B20 -x1280 -y720 -v -t0 That should just take a single shot. Try this and see what it comes back with. I find that sometimes uvccapture wants that extra parameter. Not always though. Cheers. ARc

Categories : Linux

What is the linux command line to check kernel space and User space Memory used
Try: sudo slabtop or sudo cat /proc/slabinfo These should give you enough information to estimate the total kernel memory consumption. You can read more info about kernel and userspace memory here.

Categories : Linux

How merge sub branch to main branch using clearcase command line under linux?
You can use the command cleartool findmerge for that. The key is to use a view which select those files: element * MYLABEL element * /main/LATEST And use -ftag yourLabelView You can also directly use -fver YourLabel (meaning, no need to have a special dedicated view) Go to a dynamic view set on /main, and do a: cd /view/MyView/vobs/MyVob cleartool findmerge . –fver MyLabel –whynot –print The -whynot and -print allow you to preview what would be merge and see if that fits what you expect. Once the preview seems good: cleartool findmerge . -c "Merge MyLabel on main" –fver MyLabel –merge

Categories : Linux

azure command line tool for linux machine to upload/download data to/from Azure Storage
there's support for upload and download : azure storage blob upload [options] [file] [container] [blob] azure storage blob download [options] [container] [blob] [destination] if not seeing them try to update your cli tools first: npm install azure-cli -g hope this helps

Categories : Linux

Linux: Move log files from a mounted dir to a local dir recursively while maintaining directory structure in local direcoty
How about something like rsync -azrR --include='*.log' -f 'hide,! */' /media/primary /backup If you use man rsync and type 2343g it should take you to the line where it explains this filter. Basically it will hide everything that's not a directory (every file) from the pattern matching; however, since I've used the --include='*.log' flag as well it will override that and the pattern will match only .log files. You can also use the -nv flag to do a dry run and see what would happen.

Categories : PHP

{ line-height: 0; } causing text to stick out from parent div?
In my opinion using line-height: 0 is not a good idea, because it set the height of the line of text as null. I would use absolute positioning for that matter, just adjust the top margin to position the text: div { position: relative; height: 100px; width: 500px; margin-top: 50px; background-color: #00f; } p { font-size: 20px; color: #000; position: absolute; margin-top: -4px } (jsFiddle)

Categories : CSS

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

[Qt][Linux] List drive or partitions
You need to use platform specific code. And, please, read the docs! Returns a list of the root directories on this system. On Windows this returns a list of QFileInfo objects containing "C:/", "D:/", etc. On other operating systems, it returns a list containing just one root directory (i.e. "/").

Categories : C++

SQLite3 in Embedded Linux NOR MTD Flash
Writing to the MTD every second is not a good idea at all. You will get bad sectors in no time. Try saving your sqlite file in /tmp. This will considerably enhance the speed of read/write ops and prolong the MTD life.

Categories : Linux



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