terminal

How to add shortcut letters or words in Android Studio's Terminal for frequent commands?

谁说胖子不能爱 提交于 2021-02-11 04:57:01
问题 In Android Studio's Terminal window, I use some commands too frequently and it's a lot frustrating. The commands I use a thousand times a day are: adb kill-server adb connect 192.168.43.1 While Android Studio is not restarted yet, when you type these once, you can use up and down arrow keys to select them. But the problem is that I restart AS or switch between projects so many times a day. And writing these commands over and over again is such a pain. So I thought why don't we create one

Mac terminal command input too long it does not fit?

为君一笑 提交于 2021-02-10 21:12:37
问题 I need to run the command: kubectl get pvc --field-selector metadata.name!=dataX********************************,******************************************************************,************************************************************************************************,************************************************************************************************,************************************************,*************************************************,************************

Mac terminal command input too long it does not fit?

冷暖自知 提交于 2021-02-10 21:12:30
问题 I need to run the command: kubectl get pvc --field-selector metadata.name!=dataX********************************,******************************************************************,************************************************************************************************,************************************************************************************************,************************************************,*************************************************,************************

Is there a command to list all the servers currently being run locally?

泪湿孤枕 提交于 2021-02-10 19:39:30
问题 Im sure this question has been asked before I am just having a really hard time finding it... Currently when I go to start my rails server, I am running into `initialize': Address already in use - bind(2) for "0.0.0.0" port 5000 (Errno::EADDRINUSE) obviously port:5000 is currently being used but is there is quick way to list all local web servers and to also kill said servers. Please excuse my ignorance. 回答1: ps aux | grep ruby or ps aux | grep rails find the server then kill -9 pid 来源: https

aria2c - Any way to keep only list of failed downloads?

ε祈祈猫儿з 提交于 2021-02-10 17:41:03
问题 I am using aria2c to download a quite large list of urls (~6000) organized in a text file. Based on this gist, I am using the following script to download all the files: #!/bin/bash aria2c -j5 -i list.txt -c --save-session out.txt has_error=`wc -l < out.txt` while [ $has_error -gt 0 ] do echo "still has $has_error errors, rerun aria2 to download ..." aria2c -j5 -i list.txt -c --save-session out.txt has_error=`wc -l < out.txt` sleep 10 done ### PS: one line solution, just loop 1000 times ###

aria2c - Any way to keep only list of failed downloads?

让人想犯罪 __ 提交于 2021-02-10 17:36:06
问题 I am using aria2c to download a quite large list of urls (~6000) organized in a text file. Based on this gist, I am using the following script to download all the files: #!/bin/bash aria2c -j5 -i list.txt -c --save-session out.txt has_error=`wc -l < out.txt` while [ $has_error -gt 0 ] do echo "still has $has_error errors, rerun aria2 to download ..." aria2c -j5 -i list.txt -c --save-session out.txt has_error=`wc -l < out.txt` sleep 10 done ### PS: one line solution, just loop 1000 times ###

Windows console “ESC[2J” doesn't really “clear” the screen

南楼画角 提交于 2021-02-10 16:13:46
问题 I know this kind of questions are asked frequently, but I think this one is a little different and needed to be asked. The new Windows console supports ANSI (VT100) control codes: ANSI/VT100 control codes & Windows document: the control codes. However, ESC[2J doesn't really "clear" the screen, it just scrolls down to "hide" printed contents. Only ESC[H + ESC[J really "clears" the currently showed contents on the screen. Is this a bug or it is designed to do this? Is it written on some kind of

Windows console “ESC[2J” doesn't really “clear” the screen

纵然是瞬间 提交于 2021-02-10 16:10:52
问题 I know this kind of questions are asked frequently, but I think this one is a little different and needed to be asked. The new Windows console supports ANSI (VT100) control codes: ANSI/VT100 control codes & Windows document: the control codes. However, ESC[2J doesn't really "clear" the screen, it just scrolls down to "hide" printed contents. Only ESC[H + ESC[J really "clears" the currently showed contents on the screen. Is this a bug or it is designed to do this? Is it written on some kind of

How to edit AWS Credentials in terminal?

自作多情 提交于 2021-02-10 15:53:18
问题 What is the command to edit secret key in aws configure in terminal? 回答1: Just type aws configure again (or aws configure --profile <profile_name> to edit a specific profile). If you just confirm the suggested value by hitting enter, it will remain unchanged. or Change just the aws_secret_access_key by typing $ aws configure set aws_secret_access_key <secret_key> or You can edit the AWS credentials directly by editing the AWS credentials file on your hard drive. The aws_access_key_id and the

How to source an external file in .bash_profile in OSX?

妖精的绣舞 提交于 2021-02-10 13:19:07
问题 I have defined some aliases in my .bash_profile file and aliases work as expected. e.g alias python-server="python -m SimpleHTTPServer 7070" And, When I open new terminal, typing python-server opens up a python server with current directory as root (or "/"). But I have around 10 aliases and I want to backup the aliases So I thought to create an external file which contain these aliases and am trying to source that file from .bash_profile like this source ~/personal/Dropbox/scripts/aliases.sh