command-line-interface

Install WebExtensions on Firefox from the command line

一曲冷凌霜 提交于 2019-11-27 05:13:31
I found the question How to install Firefox addon from command line in scripts? that seems to work for Firefox extensions (i.e. ones with an install.rdf file) but what about WebExtensions (extension with a manifest.json file instead)? Makyen Please see: Installing extensions Customizing Firefox: Including extensions with your distribution of Firefox The question you link on askubuntu: How to install Firefox addon from command line in scripts? is several years out of date, but does have some good information. At this point, most Mozilla add-ons, including all Firefox WebExtension add-ons, are

How to create a file in Linux from terminal window?

百般思念 提交于 2019-11-27 04:55:35
问题 What's the easiest way to create a file in Linux terminal? 回答1: Depending on what you want the file to contain: touch /path/to/file for an empty file somecommand > /path/to/file for a file containing the output of some command. eg: grep --help > randomtext.txt echo "This is some text" > randomtext.txt nano /path/to/file or vi /path/to/file (or any other editor emacs,gedit etc ) It either opens the existing one for editing or creates & opens the empty file to enter, if it doesn't exist 回答2:

How can I process options using Perl in -n or -p mode?

混江龙づ霸主 提交于 2019-11-27 04:40:31
问题 When running perl -n or perl -p , each command line argument is taken as a file to be opened and processed line by line. If you want to pass command line switches to that script, how can I do that? 回答1: There are three primary ways of passing information to Perl without using STDIN or external storage. Arguments When using -n or -p , extract the arguments in the BEGIN block. perl -pe'BEGIN { ($x,$y)=splice(@ARGV,0,2) } f($x,$y)' -- "$x" "$y" ... Command-line options In a full program, you'd

CLR and CLI - What is the difference?

我与影子孤独终老i 提交于 2019-11-27 04:18:27
问题 I want to know what exactly is the difference between CLR & CLI? From whatever I have read so far, it seems to indicate that CLI is a subset of CLR. But isn't everything in the CLR mandatory? What exactly may be left out of CLR to create a CLI? 回答1: The CLR is Microsoft's implementation of the CLI standard. 回答2: CLR is the execution environment in which a .NET application is safely hosted/run. You can see it as .NET's private Operating System that initiates and loads just before a .NET

Python interactive CLI application?

删除回忆录丶 提交于 2019-11-27 03:55:18
问题 I'm not even sure what these would be called? I used to write them in ADA running on VAX-VMS! I want to make a simple menu-driven application that would let me display menus and use the cursor keys to navigate around them, choose items and navigate around the app. All fully old school text based. I want to be able to take over the whole terminal window and display stuff in different places. Is this possible in Python? 回答1: Check out the Python HOWTO on Curses Programming with Python and here

vscode terminal: terminate process without prompt

狂风中的少年 提交于 2019-11-27 03:45:43
问题 I'm used to terminating a process in the CLI by pressing Ctrl + C twice but that doesn't work in vscode's integrated terminal. It prompts for confirmation. Is there a way to use it the same way? Or even better, with 1 keypress. 回答1: Without extensions: add "workbench.action.terminal.sendSequence" to the terminal.integrated.commandsToSkipShell list in your settings.json by going to File → Preferences → Settings, then searching for the string terminal.integrated.commandsToSkipShell , and then

Run a PHP script every second using CLI

大憨熊 提交于 2019-11-27 03:40:35
I have a dedicated server running Cent OS with a Parallel PLESK panel. I need to run a PHP script every second to update my database. These is no alternative way time-wise, it needs to be updated every second. I can find my script using the URL http://www.somesite.com/phpfile.php?key=123 . Can the file be executed locally every second? Like phpfile.php ? Update: It has been a few months since I added this question. I ended up using the following code: #!/user/bin/php <?php $start = microtime(true); set_time_limit(60); for ($i = 0; $i < 59; ++$i) { doMyThings(); time_sleep_until($start + $i + 1

argparse optional subparser (for --version)

二次信任 提交于 2019-11-27 01:50:36
问题 I have the following code (using Python 2.7): # shared command line options, like --version or --verbose parser_shared = argparse.ArgumentParser(add_help=False) parser_shared.add_argument('--version', action='store_true') # the main parser, inherits from `parser_shared` parser = argparse.ArgumentParser(description='main', parents=[parser_shared]) # several subcommands, which can't inherit from the main parser, since # it would expect subcommands ad infinitum subparsers = parser.add_subparsers

How to pass parameters from command line to $_POST in php-script?

二次信任 提交于 2019-11-27 01:18:20
I know this could sound a little weird but I need to pass some parameters to a $_POST array. Similar to the way apache does it, or any other web server. Unfortunately I couldn't find libapache2-mod-php5 anywhere for my Ubuntu. That's not easily doable. You can invoke the php-cgi binary and pipe a fake POST request in. But you'll need to set up a whole lot of CGI environment variables: echo 'var1=123&var2=abc' | REQUEST_METHOD=POST SCRIPT_FILENAME=script.php REDIRECT_STATUS=CGI CONTENT_TYPE=application/www-form-urlencoded php-cgi Note : Insufficient, doesn't work like that. But something like

SIP-Client for Raspberry Pi that works from command line?

≡放荡痞女 提交于 2019-11-27 00:58:20
问题 i want to use my raspberry pi as a SIP/VOIP-Phone, just controlling the RPI via SSH. I found some tutorials and it seems that Twinkle is one of the most useful apps for that. So i successfully installed twinkle on my RPI, one SPI-Client on my Android-Phone and for know i am able to send text messages from one to another. The thing is: I have to use the Twinkel GUI with X-Server-forwarding (currently using MacOS with X11 and iTerm). But i kind of want to automate the whole process, like using