New answers tagged

0

Editing /etc/sysctl.conf as root should work on all OS X, e.g. kern.maxprocperuid=1000 kern.maxproc=2000 kern.maxfilesperproc=10000 kern.maxfiles=20000 Otherwise you can always add the commands into your shell rc files (e.g. ~/.bashrc) or /etc/rc.local, e.g. sudo launchctl limit maxproc 1024 2048


1

To change the memory and file limits for the current shell, use ulimit (see: help ulimit). E.g. ulimit -Sn unlimited && ulimit -Sl unlimited To make it persistent, add above commands into your shell rc files (e.g. ~/.bashrc). For processes if you've reach the hard limit and you've got this error: ulimit: max user processes: cannot modify ...


0

The usual method is (writing from memory): NEWBACKUP=`date +%s` # or some other format cp -al "$OLDBACKUP" "$NEWBACKUP" rsync -aH --delete "$SOURCE" "$NEWBACKUP" Check out Easy Automated Snapshot-Style Backups with Linux and Rsync There is also a --link-dest option to rsync that I've never investigated properly.


1

Do not use apps that do not support Linux. "RMsrv Reboot" works great with starting and shutting off Linux.


0

Is there an equivalent of pstop in OS X? Yes. Send SIGSTOP to the process you want temporarily stopped. The most direct way to do that is kill -STOP $pid, but you can use any of the several other methods for sending a signal from the command line on OS X: pkill, killall or /bin/kill. (The latter as opposed to the shell builtin, that being what you ...


0

The error message is at least consistent with a failed attempt to run a command directly through ssh, e.g. ssh someuser@somehost somecommand. Depending on how zsh is started and in which configuration file you put the alias by the app it is possible that it was just not loaded. Also, the history file will only be written by interactive sessions (which is a "...


1

The top command tries to report statistics since boot time when it only reports one set; if it's set to report on a loop basis (e.g. with the -d option), the first report is since boot, the second and thereafter are for the most recent loop period only.


1

fs_usage shows information about file system usage (and related things). Given that, I suspect THROTTLED from fs_usage indicates it is disk access being throttled and not CPU (although THROTTLED is not clearly documented in the man page). OSX reduces I/O throughput of idle applications to give better performance to active ones (see this Ars article) so it's ...


0

I solved my issue by getting hints from this thread: http://superuser.com/questions/376470/how-to-reinstall-grub2-efi I did not need to use a live installation, I just booted into my ubuntu session through the grub window. I then reinstalled grub: $ apt-get install --reinstall grub-efi-amd64 This also did an update-grub automatically. It works and updated ...


0

I felt bored and I have use for such a script as well so I changed Thomas Dickey's in little ways, not in any drastic way but just e.g. so that you can deal with all sort of file names (even those with newlines) and easily change the separator between the file names (e.g. just set ORS to "\0" to forward it to xargs -z …) #!/bin/sh find "${1-.}" -type f -...


2

You can do this using the stat command. Here is a simple script which prints the filenames, with some allowances for embedded blanks: #!/bin/sh find $* -exec stat -f '%m %B %N' {} \; | \ awk '$1 == $2 { \ s=length($1)+length($2)+3; $0 = substr($0,s); print $0; }' The %m and %B are respectively the modified and birth times (which appear to be what ...


2

netpbm (brew install netpbm) can process xwd files, so you should be able to do the standard Unix X11 process: $ xwd -root -silent -out screen.xwd $ xwdtopnm < screen.xwd | pnmtojpeg > screen.jpg xwdtopnm: writing PPM file


0

Ok, it seems using import command from ImageMagick package is much easier, for example: import -window root screen.jpeg However when installing imagemagick, it needs to be compiled with X11, e.g. brew install imagemagick --with-x11


0

My guess it that you are trying to run the Python library by giving the name in your shell like this: gcloud According to this link gcloud getting started, gcloud (the Python library) can be used inside a Python script and not standalone. gcloud SDK can be installed (on Mac) following this link Cloud Platform.


1

You need to recreate the grub.cfg using the following command: grub2-mkconfig -o /boot/grub2/grub.cfg Or grub-mkconfig -o /boot/grub/grub.cfg


2

What is shell? In simple words, shell is a software which takes the command from your keyboard and passes it to the OS. So are konsole, xterm or gnome-terminals shells? No, they're called terminal emulators. They open a GUI to interact with the shell. You can think of them as a frontend to the shells. Different Shells There are different shells which ...


1

The shell is the program that runs in the terminal, that reads the commands you type and executes them. Unix and Unix-like operating systems today offer a choice between mostly the same set of shells, because these shells pre-date most of those operating systems. For further reading I recommend Evolution of shells in Linux (IBM) Edit to add information ...


0

Here is a nice post about fswatch and inotify. I am not very familiar with fswatch however I use inotifywatch all the time and it sounds like what you're looking for.


0

You can use inotify. See example code below. #!/bin/sh src_path=/directory/path/to/monitor inotifywait --format '%:e %w%f' -e modify,delete,create \ --exclude '^.+(jpe?g|gif|ico|png|svg|pdf|pptx?|swpx|swp)$' \ -m -r "$src_path" | \ while read watched_filename EVENT_NAMES; do case "$watched_filename" in MODIFY) ...


0

Okay, I solved it. Apparently the braces have to be masked: find /Users/Me/MyFolder -name '*filename.tsv' -print0 -exec bash -c '/usr/bin/java -jar -Xmx2G /Volumes/Macintosh\ HD/Applications/mMyApp/MyApp.jar -s "," -e "." "$1" > "$1-new.tsv"' {} \; Furthermore, the command has to be invoked by using bash -c 'command string' (make sure to escape single ...


0

Well as a last resort, I found an old 10/100 ethernet card from a windows 98 PC, and installed it in the server. After configuring it, I have had no more errors, over about 30 GB of data. I guess the built-in ethernet chipset didn't work well with ubuntu. Or I had somehow configured it incorrectly.


0

A Bootable USB device doesn't work that way. It would normally boot independent of your other OS and most times copied into RAM but some allow writing data for persistent boots, I.E to allow you to customize it by installing extra software on it.


0

It could be a bug in your SSH. There have been several examples of this over time. (You should definitely post the exact versions used at either end). http://www.alcatelunleashed.com/viewtopic.php?t=25294 I can't work out why a remote network path would be more reliable, or any suggestion to work on that. It can be caused by buggy network boxes though......


1

The name of your Macintosh has been changed accidentally. What you see at the prompt at the terminal is a name assigned by your DHCP server with your MAC address appended. You can rename it by, Go to System Preferences and click on Sharing. Change the Computer Name. Once you have done that, reboot your Mac. A standard name may look like "Steve Jobs' ...


0

The problem was my user-specific ~/.bash_profile file had auto-generated lines in it that look like the following: # Setting PATH for Python 2.7 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH # Setting PATH for Python 3.5 # The orginal version is saved in .bash_profile....


0

The fact that something is possible to do in bash, doesn't mean that you should, or that it's a good idea. What you are trying to do is much easier in languages like awk or perl. bash arrays are a fairly advanced usage of bash and, due to limitations in the bash/sh language itself (and the awkwardness of using them), not really as useful as arrays are in ...


0

Part of the problem is that you're indexing into the en array incorrectly.  When you index into an array, you have to use braces; not $en[$lst] but ${en[$lst]}



Top 50 recent answers are included