Interesting:
For codesign verification:
find /Applications -d 1 -name "*.app" -exec codesign --verify --verbose {} \;For system policy assessment:
find /Applications -d 1 -name "*.app" -exec spctl --assess --verbose {} \;
–jeroen
Posted by jpluimers on 2015/12/18
Interesting:
For codesign verification:
find /Applications -d 1 -name "*.app" -exec codesign --verify --verbose {} \;For system policy assessment:
find /Applications -d 1 -name "*.app" -exec spctl --assess --verbose {} \;
–jeroen
Posted in Apple, bash, Development, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.6 Snow Leopard, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2015/12/03
I wish I had seen this years ago, as I’ve always had a hate-hate relationship with many shells on many OS-es.
I’ve included the ToC; read the rest of BashPitfalls: common errors that Bash programmers make – Greg’s Wiki back-to-back. It’s worth it, really.
Bash Pitfalls
This page shows common errors that Bash programmers make. These examples are all flawed in some way.
You will save yourself from many of these pitfalls if you simply always use quotes and never use WordSplitting for any reason! Word splitting is a broken legacy misfeature inherited from the Bourne shell that’s stuck on by default if you don’t quote expansions. The vast majority of pitfalls are in some way related to unquoted expansions, and the ensuing word splitting and globbing that result.
Contents
Posted in bash, Development, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2015/10/15
LOL:
The if syntax of your script was a bit…well, iffy.
Indeed it is:
#!/bin/bash #toggle AppleShowAllFiles current_value=$(defaults read com.apple.finder AppleShowAllFiles) if [ $current_value = "TRUE" ] then defaults write com.apple.finder AppleShowAllFiles FALSE else defaults write com.apple.finder AppleShowAllFiles TRUE fi killall Finder
Even the alternative if statement is:
if [[ $(defaults read com.apple.finder AppleShowAllFiles) == TRUE ]]
–jeroen
via osx – Toggle AppleShowAllFiles with a simple bash script? – Stack Overflow.
Posted in Apple, bash, Development, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2015/05/19
Now that DynamicDNS moved itself to a fully payed service, named it DynDns Pro, then renamed it Remote Access and limiting it to 30 hosts for USD 25 a year, I looked for alternatives, and noticed NO-IP.
I like it for a few reasons:
OK, last year, there was this Microsoft Legal Action and Controversy, but I think that is a once time thing (some people even argue that Microsoft wasn’t thinking), so I created the last script below in PowerShell.
A few open-source scripts to keep your NO-IP account happy (that also work on most other DDNS providers like Duck DNS):
Posted in *nix, *nix-tools, bash, CommandLine, Development, Perl, PHP, Power User, PowerShell, Scripting, Software Development | 1 Comment »
Posted by jpluimers on 2015/02/18
Mac OS X has md5, but no md5sum.
I agree with Mac OS X: Replicating md5sum Output Format that the second way of emulating md5 is better than the first one.
So here it is:
| #!/bin/bash | |
| /sbin/md5 -r "$@" |
–jeroen
Posted in Apple, bash, Development, Hashing, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, md5, OS X 10.8 Mountain Lion, Power User, Scripting, Security, Software Development | Leave a Comment »
Posted by jpluimers on 2015/01/22
Wow: I feel like having lived under a stone for 8 years, as RosettaCode has been alive since it was founded in 2007 by Mike Mol.
The idea is that you solve a task and learn from that, or learn by seeing how others have solved tasks or draft tasks.
So in a sense it is similar to the Rosetta stone: it has different languages phrasing the same tasks.
There are already a whole bunch of languages on RosettaCode (of which a few are in the categories below), and you can even suggest or add your own languages.
When you want to solve tasks, be sure to look at the list unimplemented tasks by language that leads to automatic reports by language (for instance two of the languages I use most often: C# and Delphi).
I’m sure there are lots of programming chrestomathy sites, even beyond the ones, and it feels very similar to programming kata sites.
–jeroen
Posted in .NET, APL, Awk, bash, Batch-Files, C, C#, C++, COBOL, CommandLine, Delphi, Development, Fortran, FreePascal, Java, JavaScript/ECMAScript, Lazarus, Object Pascal, Office VBA, Pascal, Perl, PHP, PowerShell, PowerShell, Prism, Scripting, sed script, Sh Shell, Software Development, Turbo Prolog, VB.NET, VBS, VBScript, Visual Studio and tools, Web Development | Leave a Comment »
Posted by jpluimers on 2014/09/25
Unpatched bash allows for remote code execution.
Patch as soon as you can and be aware that the current patches might not be complete.
Many vendors (including Debian, Red Hat, SuSE, Ubuntu) already have patches available: CERT/NIST reveal level 10 bash alert today, 24 September 2014.
This is a long article which explains the why/how/… and has an easy check to see if you are vulnerable: What is the CVE-2014-6271 bash vulnerability and, how do I fix it.
It looks like the current patches aren’t complete yet, but do plug big parts of the hole.
Watch bash CVEs in Ubuntu and CVE-2014-7169 in Ubuntu (and maybe for other nx varieties as well).
Update:
curl https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck > bashcheck.sh
less bashcheck.sh # check if there is nothing fishy
chmod +x bashcheck.sh && ./bashcheck.sh
rm bashcheck.sh
Quote from the article:
Posted in *nix, *nix-tools, bash, Development, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2014/08/21
Just in case I need this again:
None of the mutt ones worked for me. It was thinking the email address was part of the attachemnt. Had to do:
echo “This is the message body” | mutt -a “/path/to/file.to.attach” -s “subject of message” — recipient@domain.com
Thanks Alexander Bird for noticing the double-dash, rynop for the modified answer and Chris N for the original answer.
From mutt(1): Mutt Mail User Agent – Linux man page: Read the rest of this entry »
Posted in *nix, bash, Development, Linux, Power User, Scripting, Software Development, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2014/08/20
In the the irregular series of ASUS RT-N66U and TomatoUSB posts:
Execute this script from the Tomato USB interface, or a ssh/telnet shell:
cat /dev/mtd0ro | grep bl_version
nvram get os_version
nvram get clkfreq
wl -i eth1 phy_tempsense | awk '{print $1/2+20;}'
wl -i eth2 phy_tempsense | awk '{print $1/2+20;}'
Based on those, I found a few very useful scripts:
–jeroen
Posted in ASUS RT-N66U, Awk, bash, Development, Internet, Network-and-equipment, Power User, Scripting, Software Development, TomatoUSB | Leave a Comment »
Posted by jpluimers on 2014/06/24
Last week, I thanked Jaykul for helping me out on PowerShell.
But he taught me another thing that was new for me: on his site, he has hidden his email address behind a 302-redirect.
I didn’t even realize that was possible until I saw his site start my mail program without initially showing a mailto in the url. A quick check showed me he was using a 302-redirect: Read the rest of this entry »
Posted in *nix, Apache2, bash, Development, Linux, Power User, Scripting, Software Development, SuSE Linux, wget | Leave a Comment »