terminal

Reset MySQL root password to “default” - MAMP

隐身守侯 提交于 2019-12-31 23:37:34
问题 I changed my root level password on phpMyAdmin. I was unsure where to enter the password itself, as it did not give me the option (login form). I wondered if it was the php.ini file but users with read privileges could read it if I placed the password in there. Now, the mysql doesn't run as I tried various online resources to fix the problem. If needs be I would delete mamp and re-install but I do not want to lose my database files. Ideally I would revert the password to default, which I

mvn command not found in OSX Mavrerick

人盡茶涼 提交于 2019-12-31 08:44:30
问题 Before marking this as duplicate, I went through these posts, but nothing helped. 'mvn' is not recognized as an internal or external command, Getting -bash: mvn: command not found, Can't access mvn command from command line? Some are specific to windows and did not help. A couple of them on Mac OS X gave suggestions, that I tried but did not help. What I tried (this is exactly what Maven suggests): Extract the distribution archive, i.e. apache-maven-3.1.1-bin.tar.gz to the directory you wish

Node.js console.log vs console.info

眉间皱痕 提交于 2019-12-31 08:40:33
问题 What is the benefit of using console.log vs console.info ? Or any of the other console commands for that matter? console.info("info"); console.error("error"); console.warn("warn"); vs console.log("log"); I thought it might change the color of the output or concatenate some sort of label, but they seem to all do the same thing. And according to the documentation here: https://nodejs.org/api/console.html#console_console_info_data they seem to all do the same as console.log 回答1: According to the

.gitignore doesn't stop changes being tracked in files

白昼怎懂夜的黑 提交于 2019-12-31 08:38:04
问题 Changes I make to a file that's within my .gitignore are being tracked by git. File structure: .gitignore wp-config.php Contents of .gitignore : wp-config.php When I change wp-config.php , and then run git status I see that it has been modified: alex$ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: wp-config.php # How to I stop

Command key as Meta key in OS X Terminal.app

ε祈祈猫儿з 提交于 2019-12-31 08:33:14
问题 When i unckeck the 'Use option as meta key' box in Settings, and then do Cmd + F (which i want to mean Meta + F for forward-word in bash) Terminal gives me a 'find word' popup, which isn't what i want. What i really want is for my Terminals to behave just like an xterm w.r.t. the key bindings. Is there any way to disable this popup and its binding? I know i could just use actual xterms, but for a variety of reasons i want to use Terminal. thanks in advance, Eric 回答1: The option as meta key

find and remove a line in multiple files

江枫思渺然 提交于 2019-12-31 07:35:13
问题 I have many files, and I have to find a single line in these files and delete, and should be in terminal in linux. Anyone know how to do? Example FileSystem myFiles + file1 + file2 ... + file6500 The file aaa0 aaa1 .... fff9 回答1: This would delete that line in each file. for f in myFiles/*; do sed -i 'd/pattern that matches line that you want to delete/' $f done Alternatively you could use awk as well. tmp=$(mktemp) for f in myFiles/*; do awk '!/pattern that matches the line that you want to

error when compiling - linking .cpp & header file

て烟熏妆下的殇ゞ 提交于 2019-12-31 04:20:29
问题 I'm attempting to link my .cpp implementation file with my header file - I get this error message from my mac terminal - rowlandev:playground rowlandev$ g++ main.cpp -o main Undefined symbols for architecture x86_64: "Person::Person()", referenced from: _main in main-32e73b.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Here is the code in my cpp file: #include <iostream> #include "playground.h" using namespace

Vertical vim cursor in command mode

半城伤御伤魂 提交于 2019-12-31 04:08:10
问题 Im on mac and I have my terminal cursor set to the vertical bar option. However in vim command mode the cursor is the vertical bar but it wont let me use hjkl to go to the end of the line, it always stops right before the end. This is especially annoying because you have to use the arrow keys in insert mode to make the cursor go the end of the line. Any fix would be appreciated eg: hello worl | d , what I want is hello world | 回答1: I think you're looking for set virtualedit=onemore . From

how to insert ctrl+d into my linux script?

心已入冬 提交于 2019-12-31 04:07:08
问题 I want to make the following commands: cat > template.txt [enter in the terminal] text [Ctrl+d in the terminal] in a script. Is there a way to tell the script to do enter\Ctrl d? Is there a way to create a file and write to it in script? I didn't find anything that worked for me. Thanks. 回答1: A Here Document is kind of like a script version of what you're talking about, I think, although it is not entirely clear to me from your description. #!/bin/bash cat > template.txt <<- EOF Here is some

Differences in controlling daemons & applications

拟墨画扇 提交于 2019-12-31 03:54:11
问题 With respect to this excellent post: What's the difference between nohup and a daemon? I would like to ask the following: After launching an application from my terminal, the application keeps running either in the background or the foreground and the only thing I can do to interact with it is by sending it signals from my terminal (given that stdin is still in place). However, after a daemon process is launched, I realized that it can be controlled with other means like querying it or