terminal
Recursively batch process files with pngquant
If you have limited depth of directories and not too many files, then lazy solution: pngquant *.png */*.png */*/*.png A standard solution: find . -name ‘*.png’ -exec pngquant –ext .png –force 256 {} \; and multi-core version: find . -name ‘*.png’ -print0 | xargs -0 -P8 -L1 pngquant –ext .png –force 256 where -P8 defines … Read more
Execute a command on Remote Machine in Python
Sure, there are several ways to do it! Let’s say you’ve got a Raspberry Pi on a raspberry.lan host and your username is irfan. subprocess It’s the default Python library that runs commands. You can make it run ssh and do whatever you need on a remote server. scrat has it covered in his answer. … Read more
Nano syntax highlighting in Mac OS X 10.7 (Lion)?
On Mac, Homebrew (brew) will allow you to easily upgrade nano to a newer version than the one that came with Mac OSX. Install brew, then install a new version of nano from the Terminal. brew install nano Installing this way includes the /usr/local/share/nano folder containing the default syntax highlight files. See also the extra … Read more
Terminal vs Console vs Shell vs Command Prompt? [closed]
Yes, there is a lot of confusion about these terms. I’ll give it a stab, but with the proviso that this is really semantics and the terms are used interchangeably in everyday speech : “Shell” is the term used for any program which runs others. It wraps around another program, hence its name. So for … Read more
HIstory command only showing last 15 commands [duplicate]
The history n command, where n is a number shows all history since line n. So in your case, history 904 will show the last 100 commands.
Run a shell script in new terminal from current terminal
Here’s a simple example to get you started: To write a shell script, do this on your command prompt: echo -e ‘#!/bin/sh\n echo “hello world”‘ > abc.sh This writes: #!/bin/sh echo “hello world” To a file called abc.sh Next, you want to set it to executable by: chmod +x abc.sh Now, you can run it … Read more
React Native – FBReactNativeSpec Command PhaseScriptExecution failed with a nonzero exit code
For me anyone of this solutions work because, with Xcode 14.2 and RN0.70.5, there is the following 2 files in ios folder which fixe node version with the path (I don’t know since which version and which one adds this files) : .xcode.env .xcode.env.local If you are this files inside ios folder just do this … Read more
Copy files while skipping over files that exist – Unix [closed]
Always use rsync for copying files, because It Is Great. To ignore existing files: rsync –ignore-existing –recursive /src /dst Do read the manual and search around for many, many great examples. Especially the combination with ssh makes rsync a great tool for slow and unreliable connections on account of its –partial option. Add –verbose to … Read more