Tag Info

Hot answers tagged

8

If you don't want to be challenged every time for your password then I'd recommend setting it to NOPASSWD in your /etc/sudoers file rather than hardcode your password in your logins. At least this way your primary login's password will remain intact and not be completely exposed in your .bashrc. To make this change run the command sudo visudo, and change ...


5

If the filesystem takes over the whole disk, OS X currently uses a name like /dev/disk5. If the disk is partitioned, it adds an s# suffix, like /dev/disk5s2 for the second partition. (s is short for "slice," a BSDism functionally equivalent to a partition.) Disks are numbered sequentially in discovery order by the OS, on boot, so you may have to experiment ...


4

In Linux, you can try this: top -bn1 > output.txt From man top: -b : Batch-mode operation Starts top in 'Batch' mode, which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit you've set with the ...


3

To my knowledge /dev/shm is a Linux-only feature. I just doubled checked on my OSX 10.9.4 system and it definitely does not have /dev/shm. Now given OSX is rooted in Unix I would be very surprised if it did not have something similar, so searching for the equivalent led me to this SO Q&A titled: Does OS X have an equivalent to /dev/shm?, which in turn ...


2

The -i switch causes sed to edit the original file. That means there is no output and since there is no output, your redirection results in an empty file. So, what you want is either sed -i '' 's/$/<@string>/' txt.txt which will change the original txt.txt. Or, just sed 's/$/<@string>/' txt.txt > txt2.txt


2

I started using @Gilles's answer, but found that if the terminal changed the number of columns the prompt would no longer be at the start of a line as expected. This can happen for a variety of reasons, including tmux/screen splits, manual resizing of a GUI container, font changes, etc. What I really wanted was something that would add a newline if the ...


2

I found this tutorial. It's untested by me but several commenters to the article attested to it working. The article is titled: Mount a ufs2 Volume in MacOS/X 10.7 (Lion). excerpt If you have to mount an ufs2 volume (for example an external FreeNAS disk) in MacOS/X Lion, you can do the following: Download and install OSXFUSE from ...


1

Installation of ruby can be easily done using curl: curl -sSL https://get.rvm.io | bash and is listed in the main rvm site here. After this operation is complete type rvm in the command line to check if it installed properly and if it did, it lists out its usage and other things. Ruby is usually pre-installed in most linux ditributions. To check ...


1

The default behavior of nc is to close the connection if stdin is closed. To change you can use the -q option (like -q -1) on Linux, it might be the same on OS X. See the man page for details. Edit: looks like OS X nc does not support -q switch or anything similar. In this case you need to make sure that stdin gets not closed by doing somehing like this: ( ...


1

Can't you do it from Finder? Also please make sure the external drive is really OSX Extended Journal. It appears it is either NTFS or FAT32.


1

If you have space, please back up the disk as a whole (e.g. dd if=/dev/sdb of=disk.img bs=1M), before running random programs like fsck on things that you don't think are valid partitions :p. I'm not saying you've damaged it, but there's a very good chance of doing so while experimenting. The partition table shown by parted & the kernel looks ...


1

It's kind of one of those things you just have to experience to really understand it. For one, the community is really supportive and educated. You don't get as many of the "Why do you even want to know that?" reactions out of Linux users that you do with users/developers of other operating systems. I would suggest just using it for a few months and getting ...


1

Put the file to ~/.vim/syntax/xt.vim, and ensure that you have :syntax on in your ~/.vimrc. To edit a file with that syntax highlighting, use :edit +setf\ xt the-file or define a filetype detection rule, cp. :help new-filetype.


1

I would comment for your follow-up question but lack enough reputation. To get similar type numbers from a Windows system you will want to take a look at powershell. Just to get a list of processes you and look at get-process. Take a look at this reference. In doing some further searches, found a nice little command here. Which if you take out of the ...


1

I have extended your script, so that you can run it once on startup and it will do it's job between 9PM and 9AM. #!/bin/bash -· LOGFILE="/tmp/autotest_run_count.txt" trap "echo manual abort; exit 1" 1 2 3 15 RUNS=0 while [ 1 ] ; do· HOUR="$(date +'%H')" if [ $HOUR -ge 21 -a $HOUR -lt 9 ] ; then # run program libreoffice || exit 1 ...


1

try do some example, your system supports chained symlinks, for example cd ln -s /bin/ls myls1 ln -s myls1 myls2 ln -s myls2 myls3 start experiment: ./myls1 should work ./myls2 works or not? ./myls3 works or not? When myls3 works, your system supports chained symlinks. I don't belive it doesn't :) Then I think problem is not with symlinks, but with ...


1

I use the default combination on my MacBook Pro: fn+⇧+↑ or fn+⇧+↓. In documentation it is often shown as ⇞ or ⇟



Only top voted, non community-wiki answers of a minimum length are eligible