command

Laravel 5 Command Scheduler, How to Pass in Options

孤街醉人 提交于 2019-12-05 03:02:38
I have a command that takes in a number of days as an option. I did not see anywhere in the scheduler docs how to pass in options. Is it possible to pass options in to the command scheduler? Here is my command with a days option: php artisan users:daysInactiveInvitation --days=30 Scheduled it would be: $schedule->command('users:daysInactiveInvitation')->daily(); Preferably I could pass in the option something along the lines of: $schedule->command('users:daysInactiveInvitation')->daily()->options(['days'=>30]); You can just supply them in the command() function. The string given is literally

PowerShell Pass Named parameters to ArgumentList

主宰稳场 提交于 2019-12-05 02:41:15
I have a PowerShell script that accepts 3 named parameters. Please let me know how to pass the same from command line. I tried below code but same is not working. It assigns the entire value to P3 only. My requirement is that P1 should contain 1, P2 should 2 and P3 should be assigned 3. Invoke-Command -ComputerName server -FilePath "D:\test.ps1" -ArgumentList {-P1 1 -P2 2 -P3 3} Ihe below is script file code. Param ( [string]$P3, [string]$P2, [string]$P1 ) Write-Output "P1 Value :" $P1 Write-Output "P2 Value:" $P2 Write-Output "P3 Value :" $P3 One option: $params = @{ P1 = 1 P2 = 2 P3 = 3 }

Difference between starting a command using init.d script and service start

谁都会走 提交于 2019-12-05 02:35:08
I need to understand the difference between starting a command using init.d script and service start . For example what is the difference between /etc/init.d/nginx start and service nginx start . They do the same thing except service runs the script in a controlled environment. From the service(8) man page : DESCRIPTION service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working directory set to / . ENVIRONMENT LANG , TERM The only environment variables passed to the init scripts. Furthermore: Calling /etc/init.d/*

Adb install progress bar

ぃ、小莉子 提交于 2019-12-05 00:53:55
I'm a beginner at this so just mind me if I ask anything obvious. I'm trying to install an apk to my device using adb install apk.apk however, the apk is around a few hundred MB big and it takes some time. Is there some sort of progress bar that I could implement in the command window to show the progress? I've seen stuff for adb push/pull . I'm not sure if it's the same. I'm running this in Windows 8.1 . I also have an adb environment variable set up. Thanks so much. Well, adb install apk.apk is just a glorified shortcut for: adb push apk.apk /data/local/tmp adb shell pm install /data/local

hiding system command results in ruby

十年热恋 提交于 2019-12-05 00:28:59
How easy is it to hide results from system commands in ruby? For example, some of my scripts run system "curl ..." and I would not prefer to see the results of the download. You can use the more sophisticated popen3 to have control over STDIN, STDOUT and STDERR separately if you like: Open3.popen3("curl...") do |stdin, stdout, stderr, thread| # ... end If you want to silence certain streams you can ignore them, or if it's important to redirect or interpret that output, you still have that available. Easiest ways other than popen: Use %x instead of system. It will automatically pipe rval = %x

Android : NFC APDU command response '6700' Wrong length'

限于喜欢 提交于 2019-12-04 23:17:21
I am sending below APDU command to ISODep tag and I am getting '6700 wrong length' byte[] command = new byte[]{ (byte)0x80, (byte)0xD0, (byte)0x01, (byte)0x00, (byte)0x07,(byte)0x22 , (byte)0x22,(byte)0x12 , (byte)0x34 , (byte)0x56 , (byte)0x78 , (byte)0x90 }; Please suggest if something is wrong in above command. You are sending a case 4 APDU there, right? Your Lc indicates 0x07 bytes of data, and there's a Le of 0x90 trailing. Check with your specification whether this command is actually expecting a case 4 structure, or whether you just got the data length in the Lc field wrong (0x08

Laravel 5 - how to run a Controller method from an Artisan Command?

倖福魔咒の 提交于 2019-12-04 22:48:50
问题 I need some code from my Controller to run every ten minutes. Easy enough with Scheduler and Commands . But. I've created a Command , registered it with Laravel Scheduler (in Kernel.php ) and now I am unable to instantiate the Controller . I know it's a wrong way to approach this problem, but I just needed a quick test. Is there a way, mind you a hacky way, to accomplish this? Thank you. Update #1: The Command : <?php namespace App\Console\Commands; use Illuminate\Console\Command; use App

PostgreSQL命令行工具

删除回忆录丶 提交于 2019-12-04 22:22:28
简介 pgcli 是 针对 PostgreSQL的命令行工具,他的特色是对SQL能够语法高亮显示,并且能对输入进行自动提示。(同时,针对MySQL也有一个类似的命令行工具 mycli )。 网站: http://pgcli.com/ 授权协议: BSD 3-clause license 开发语言: Python 支持系统: Linux , OS X , Windows理论上可以但尚未测试过。 安装试用 环境:centos 32bit. 数据库:PostgreSQL9.4 1.安装PostgreSQL 编译安装或者安装包图形化安装均可。可参考: PostgreSQL在Linux下的源码编译安装 。 2.安装python 安装python。可参考: python开发环境搭建与连接PostgreSQL数据库 。 3.安装python-pip 首先试用yum安装python-pip,结果显示没有可用的包。 [root@localhost ~]# yum install python-pip Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.cqu.edu

bash for inline command

空扰寡人 提交于 2019-12-04 22:22:03
I have to run commands, in a bash script, and within this bash script I have to run other commands. I am running CentOS. I found 2 ways to do this on blogs and manuals: 1) using the ticks or accent char command `sub command` or 2) using the dollar sign and parentheses command $(sub command) What is the difference between the 2 and which one is preferable to use? There's no difference except in "nestability": The $() is nestable: $ echo $(echo "hi" $(echo "there")) while the `` is not. Others have pointed out the difference in syntax (basically, $() is slightly cleaner wrt nesting and escapes),

using AT commands. of service in response encoding and read Chinese or Arabic for Nokia phones

半世苍凉 提交于 2019-12-04 22:07:56
I am developing an application for GSM Modems using AT commands. I have a problem reading Unicode messages or ussd example: that dcs=17 not 7 or 15 or 72 Two years ago, and I'm looking for a solution to no availI was able to find a partial solution through the use of Chinese phone where the phone can read Chinese codingBut all Nokia phones do not support the codec Arabic or ChineseAnd service responses appear incomprehensible symbols Example: +CUSD: 0,"ar??c ?J <10???@d@??? @0@??@D? ?Z?xb @ $@?@?@Z@@?? @-@H?@???@b@@$? @3@h?P???@??(??",17 But when you use the phone shows the Chinese response