terminal

Make MIMETYPE file the first file in an EPUB ZIP file?

て烟熏妆下的殇ゞ 提交于 2019-12-08 04:18:42
问题 My goal is to create an EPUB file via an AppleScript, and I'm starting with semi-manually generating an EPUB file. My issue is that the IDPF EPUB validator reports that my MIMETYPE file isn't isn't the first file in my EPUB package or that my MIMETYPE doesn't exist. My AppleScript is creating the EPUB folder structure and a MIMETYPE file: set EPUBMIMETYPEfilepath to ((EPUBfolderPath & ":MIMETYPE") as string) set referenceToEPUBMIMETYPEfile to a reference to file EPUBMIMETYPEfilepath open for

Using find and grep to Mimic findstr Command [closed]

。_饼干妹妹 提交于 2019-12-08 04:18:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I recently switched from a Windows development environment to an Apple development environment. The move has been a challenging process, but I'm struggling with picking up UNIX based commands in terminal to makeup for the commands I used on a daily basis in Windows command prompt. Any help would greatly

Keep play application running after putty terminal closed

谁说胖子不能爱 提交于 2019-12-08 04:16:01
问题 How to keep play application running after putty terminal closed? After deploying play application in to server, I ssh'ed into server with putty terminal and ran the play application. However, once I close the putty terminal, play application no longer accepts http requests from client. To start the play application I used following command; ./{myplayapp}/bin/{executable} -Dhttp.port=8000 回答1: use screen to start your application. view existing screens with "screen -ls" and switch between

Char Array and getline in C

ぃ、小莉子 提交于 2019-12-08 04:00:15
问题 int bytes_read; int rv; int nchars = 200; /*max possible number for the input of the user*/ size_t nbytes = nchars; /*size of chars in bytes*/ char *commands[2]; char *line = malloc(nbytes + 1); bytes_read = getline(&line, &nbytes, stdin); /*read line from stdin*/ if (bytes_read == -1) { printf("Read line error"); exit(-1); } else { if (line[strlen(line-1)] == '\n') { line[strlen(line-1)] = '\0'; /*change new line character in the end of the line of stdin*/ } } if (strcmp(line,"exit") == 0) {

Jekyll: Error: Site could not be built, wrong date format

戏子无情 提交于 2019-12-08 03:45:38
问题 When I run this in my command line: $ bundle exec jekyll serve I get this error: Invalid date '': Document 'vendor/cache/gems/jekyll-3.3.0/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter. The front matter in the faulty file looks like this: --- layout: post title: "Welcome to Jekyll!" date: <%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %> categories: jekyll update --- I have updated my gems and installed Xcode . But I

Mac terminal error -bash: command not found - El Capitan 10.11.13

£可爱£侵袭症+ 提交于 2019-12-08 03:26:17
问题 I'm getting an error message when I first open my Mac terminal - -bash: Applications: command not found Oddly (or maybe not so oddly), when I open another tab, I sometimes get a different error - -bash: README.md: command not found or -bash: [: missing `]' I just noticed that this morning... there are two things that I did last night that I feel may have led to this, but I'm not sure if I am correct, nor do I know how to appropriately fix this issue. My OS is El Capitan 10.11.13. First off,

Can you use the tac command in Terminal?

我是研究僧i 提交于 2019-12-08 03:18:32
问题 I'm trying to search a large file in reverse order from the command line (using terminal). I found the tac command: http://clifgriffin.com/2008/11/25/tac-and-reverse-grep/ tac is the inverse of cat. However, when I try to use the tac command in terminal, it says that command doesn't exist. Is there a way I'd be able to use tac in terminal? What are some other fast ways to search a file from the end via the command line? 回答1: The MacOs version of tail support the -r ("reverse") option, and

Could not find conda environment

倾然丶 夕夏残阳落幕 提交于 2019-12-08 03:12:20
问题 I am trying to re-enter my conda environment but I am having trouble doing so as when I type conda activate (evironment name) or source activate (environment name) both return the error 'Could not find conda environment.' This is very strange as when I type conda info --envs , I get this: # conda environments: # base * /Users/(my name)/anaconda3 /anaconda3/envs/(environment name) 回答1: Names and Prefixes For a Conda env to have a name it must be installed in one of the envs_dirs directories

How to run a lua file in cmd from Sublime Text 3?

独自空忆成欢 提交于 2019-12-08 03:06:27
I want to run lua files in cmd (for a reason I can't use build system). How can I do this? r-stein Since you just want to call a cmd command you can easily write your own plugin. Just open your user directory and create a python file (e.g. run_lua.py ). Or just go with Tools >> New Plugin. This plugin runs the command lua $file and afterwards pauses until the user pressed a key: import subprocess import sublime_plugin class RunLuaCommand(sublime_plugin.WindowCommand): def run(self): view = self.window.active_view() subprocess.Popen(["cmd", "/c", "lua", view.file_name(), "&", "pause"]) Add the

Operation not permitted when executing 'killall' with Swift

跟風遠走 提交于 2019-12-08 03:04:07
问题 I'm trying to create a menu bar app to hide desktop icons and hopefully various other things mostly to learn more about Swift, and for some reason I can't get it to work. When I run this program and click on one of the menu items, nothing happens and I get this warning in the console: killall: warning: kill -TERM 15175: Operation not permitted Other commands work, but any variant I try on "killall" spits out something like the above. Currently my code looks like this: @discardableResult func