Check These Out
Use ImageMagick to create a "black and white" copy of an image.
This is a equivalent to the GNU ' readlink' tool, but it supports following all the links, even in different directories.
An interesting alternative is this one, that gets the path of the destination file
$ myreadlink() { [ ! -h "$1" ] && echo "$1" || (local link="$(expr "$(command ls -ld -- "$1")" : '.*-> \(.*\)$')"; cd $(dirname $1); myreadlink "$link" | sed "s|^\([^/].*\)\$|$(dirname $1)/\1|"); }
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22)
(all files & folders on destination server/folder will be deleted)
Since the original command (#1873) didn't work on FreeBSD whose stat lacks the "-c" switch, I wrote an alternative that does. This command shows also the fourth digit of octal format permissions which yields the sticky bit information.
works on Linux and Solaris. I think it will work on nearly all *nix-es
alternative to
$curl ifconfig.me
for those that don't have curl
When I'm testing some scripts or programs, they end up using more memory than anticipated. In that case, computer nearly halts due to swap space usage, and sometimes I have to press Magic SysRq+REISUB to reboot.
So, I was looking for a way to limit memory usage per script and found out that ulimit can limit memory. If you run it this way:
$ $ ulimit -v 1000000
.
$ $ scriptname
Then the new memory limit will be valid for that shell. I think changing the limit within a subshell is much more flexible and it won't interfere with your current shell ulimit settings.
note: -v 1000000 corresponds to approximately 1GB of RAM
This command uses the "exiftool" command which is available here: http://www.sno.phy.queensu.ca/~phil/exiftool/
NB, there should be a degree symbol right after the first "%d" NOT a question mark.
For some unknown reason, commandlinefu is not able to handle degree symbol correctly ("?")?
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Btrfs reports the inode numbers of files with failed checksums. Use `find` to lookup the file names of those inodes. The files may need to be deleted and replaced with backups.