Posts

Showing posts with the label terminal

Strange behavior of vim color inside screen with 256 colors

Strange behavior of vim color inside screen with 256 colors I was trying to make the syntax highlighting (with 256 colors) of vim work inside screen , which is running inside gterm . vim screen gterm It works quite fine in the beginning. What I mean by "in the beginning" is, after I start screen , and enter vim , the colors look fine, and there are really 256 colors. screen vim But after a while (I don't know exactly how long) the colors automatically change back to an appearance as if there are only 8 (or 16?) colors. For example, after this has already occurred, if I enter the command hi Comment ctermfg=68 inside vim , the comments appear to be "pure" green; however, if I open another vim outside screen (in the same terminal), then with the same command the comments appear to be a "yellowish" green. vim vim The following is my .screenrc settings related to color: attrcolor b ".I" defbce "on" termcapinfo xterm 'Co#256:AB=E[48...

How do I write a script to identify and manipulate a specific drive in the terminal?

How do I write a script to identify and manipulate a specific drive in the terminal? I'm trying to write a short script that can automatically unmount and remount a partition, without knowing where the drive is currently mounted. The following command sort of works for me: sudo umount /dev/sdX sudo mount -t ntfs /dev/sdX /mnt/rec The issue is, I'm running Linux live, and can't install it on my hard drive. As such, whenever I reboot the computer, /dev/sdX will sometimes mount as /dev/sdb, or /dev/sdd. As such, I can't just run a script to automatically mount the drive where I need to, without using sudo fdisk -l In order to verify what the drives are currently mounted as. My question is: Is there a way to identify a drive, that's agnostic to where it's currently mounted? What does it mean to identify the drive independent of where it is mounted? What's on the drive to tell you it is the one you're after? – ...

Can't install TypeScript on MacOS - Terminal Error

Can't install TypeScript on MacOS - Terminal Error I have Visual Studio Code on my Mac and want to install TypeScript for Angular. I already previously installed Node.js or Git I think. This command from the TypeScript website should install TypeScript if it's run in the Mac Terminal, but it doesn't: npm install -g typescript If I paste it in the Terminal and press enter, this Error-code appears in the Terminal: (What is the problem? I really don't get it and have no clue about the terminal, I'm not a computer pro. Would be a big help if you have tips in easy words for beginners. Thanks!!) MacBook-Pro:~ Max$ npm install -g typescript npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! { [Error: EACCES: permission denied, access '/usr/lo...