terminal

get language of currently logged in user via applescript

让人想犯罪 __ 提交于 2019-12-13 04:01:37
问题 I want to get the system language of the currently logged in user. The line set lang to do shell script "defaults read NSGlobalDomain AppleLanguages" returns an string, which looks like ( en, de, ja, fr, es, it, pt, "pt-PT", nl, sv, nb, da, fi, ru, pl, "zh-Hans", "zh-Hant", ko, ar, cs, hu, tr ) returns the users languages, but how can I get the first one of this 'array'? Is there a possibility to parse this as an array an get its first value? 回答1: There's a more direct method. Applescript has

Commands to Configure unix telnet to show and receive hex characters

纵然是瞬间 提交于 2019-12-13 03:49:51
问题 I have a special application (8051 simulator from ucsim) on a local server that transmits and expects non-printable characters on only one port. Essentially, I'm defining my own data format. Telnet would have been the perfect program if I can see the hex codes of each character returned back in 30 columns as well as being able to type hex codes of characters going out. Problem is, the telnet shipped with Linux only allows 1 row of hex characters and may alter behaviour when certain characters

How can I delete all files in my folder, except Music -subfolder?

寵の児 提交于 2019-12-13 03:48:43
问题 Duplicate Unable to remove everything else in a folder except FileA I guess that it is slightly similar to this: delete [^Music] However, it does not work. 回答1: Put the following command to your ~/.bashrc shopt -s extglob You can now delete everything else in the folder except the Music folder by rm -r !(Music) Please, be careful with the command. It is powerful, but dangerous too. I recommend to test it always with the command echo rm -r !(Music) 回答2: The command rm (ls | grep -v '^Music$')

Bad: modifier error when installing RVM

限于喜欢 提交于 2019-12-13 03:38:32
问题 I'm trying to run source /Users/alastair/.rvm/scripts/rvm , but keep getting: Bad : modifier in $ ("). Where would the problem be? Happy to paste other files in if these would help. 回答1: Are you in any case running a shell that is not Bash or ZSH ? Bash >= 3.2.25 or ZSH >= 4.3.10 is required. Your problem looks like you were using minimalistic shell sh which is not supported by RVM . You can check user shell in /etc/passwd and change it with chsh -s /path/to/new/shell - list of allowed shells

How to create package file similar to Logic or Final Cut project

这一生的挚爱 提交于 2019-12-13 03:34:13
问题 I am trying to create a file in OS X that is essentially a package that has files in it, similar to how a Logic project is a single file but contains all of the audio files within it (when you right-click the file it has the "Show Package Contents" option). Doing this in Swift would be great, but also curious just in general how this is done? I haven't had much luck. 回答1: You need to define a "Document Package" type. Basically these "packages" are just a directory with a file extension

Mac OS and Visual Studio errors

余生颓废 提交于 2019-12-13 03:26:44
问题 This is the error I'm getting when I attempt to run this project. There is nothing more in this module than simple code enough to display "hello world" I am running the same exact version of visual studio on another macbook I have with the same exact settings and it works perfectly. Any nudge in the right direction would be greatly appreciated. /usr/local/share/dotnet/sdk/2.2.300/Current/Microsoft.Common.props(62,3): error MSB4019: The imported project "/Users/indianacones88/Documents/C#:ASP

“python: can't open file 'manage.py': [Errno 2] No such file or directory” when running tmux shell script?

核能气质少年 提交于 2019-12-13 03:15:16
问题 I am trying to run a very simple tmux shell script called "split.sh" which splits the terminal windows. split.sh: #!/bin/bash ~/build/tmux-1.5/tmux split-window -h ~/build/tmux-1.5/tmux split-window -v ~/build/tmux-1.5/tmux split-window -h When I type the command "sh ~/build/tmux-1.5/split.sh", this shell script runs fine, splitting the terminal windows. However, when I set an aliases, alias sp='sh ~/build/tmux-1.5/split.sh' and then run "sp", the terminal gives me a wierd error: python: can

How to use setfillstyle() and textcolor() in C

∥☆過路亽.° 提交于 2019-12-13 02:59:42
问题 I want to use setfillstyle() and textcolor() in UBUNTU(terminal) . But I found on internet that it is store in conio.h library which cannot be used in UBUNTU . So what should I do ? 回答1: The de facto way to do these things on unixy terminals today is to use some Curses libray, which on Ubuntu is Ncurses library developed by GNU Project. Google for "ncurses tutorial" to get started. It is different from conio.h , so just learn it from scratch. 回答2: That's true. setfillstyle and textcolor are

How to do a textbox in terminal ruby applications?

柔情痞子 提交于 2019-12-13 02:37:51
问题 How to do a textbox in terminal ruby applications? Is there a gem for this or it can be done using pure ruby. 回答1: If you are on Ruby 1.9.x, you can take a look at rbcurse, a ruby based curses widgets: fields, buttons, textarea. menus, message boxes, tabbed panes, tables, listboxes, splitpanes, scrollpanes. Event based, MVC architecture. The developer recently split the functionality up into https://github.com/rkumar/rbcurse-core https://github.com/rkumar/rbcurse-extras https://github.com

How to get putty terminal to show the whole output of a command?

你说的曾经没有我的故事 提交于 2019-12-13 02:15:03
问题 I have got a CISCO 1900 series router. When I type a command that will give me a long output it stops showing it when the "press enter to show more" line should be written. The problem is not with the router itself, because on hyperterminal it is working as it should, but with the putty. I cannot find any options in the settings to enable longer outputs. Can anyone help me in this? 回答1: When I run command and expect alot of output I will ussualy pipe it to the less program (some people use