:::: MENU ::::

Posts Categorized / Uncategorized

  • Sep 27 / 2019
  • Comments Off on MacOS – Prevent the automatic creation of a .DS_Store file on network drives

MacOS – Prevent the automatic creation of a .DS_Store file on network drives

Mac OS X is automatically creating .DS_Store file as soon as you’re working on some network drives. This is used to store some custom attributes.

If you want to prevent the OS to create those files automatically, follow the steps below:

  • Open up a Terminal
  • Run this command
    defaults write com.apple.desktopservices DSDontWriteNetworkStores true
  • Restart your Mac

Once this is executed, the DS_Store files will only be created on local drives.

  • Mar 29 / 2017
  • 0

MonitWeb – Architecture and security

Check instantly your infrastructure health like certificate expiration or unexpected opened ports. Stay updated with daily security feeds and get custom and automated reports.

Need further assistance for designing your architecture or get some security insights for an existing app? Get in touch with experts to get custom and complete assistance!

MonitWeb: https://www.monitweb.com

  • Jan 02 / 2017
  • 0

iTerm – Automatic mutliple panes with AppleScript

It’s often very useful to automate opening of multi panes with iTerm to execute many commands or getting access to many servers at the same time. This can be done through AppleScript.

You can copy this script and save it as multi-panes.scpt

#! /usr/bin/osascript

-- List actions to perform
set actions to {¬
	{action:"echo 'I am the window 1'"}, ¬
	{action:"echo 'I am the window 2'"}, ¬
	{action:"echo 'I am the window 3'"}, ¬
	{action:"echo 'I am the window 4'"}, ¬
	{action:"echo 'I am the window 5'"}, ¬
	{action:"echo 'I am the window 6'"}, ¬
	{action:"echo 'I am the window 7'"}, ¬
	{action:"echo 'I am the window 8'"} ¬
-- Count number of actions
set num_actions to count of actions

-- Set cols and lines
set num_cols to round (num_actions ^ 0.5)
set num_lines to round (num_actions / num_cols) rounding up

-- Start iTerm
tell application "iTerm"
	# Create new tab
	tell current window
		create tab with default profile
	end tell
	-- Prepare horizontal panes
	repeat with i from 1 to num_lines
		tell session 1 of current tab of current window
			if i < num_lines then
				split horizontally with default profile
			end if
		end tell
	end repeat
	-- Prepare vertical panes
	set sessid to 1
	repeat with i from 1 to num_lines
		if i is not 1 then set sessid to sessid + num_cols
		if i is not num_lines or num_actions is num_cols * num_lines then
			set cols to num_cols - 1
			set cols to (num_actions - ((num_lines - 1) * num_cols)) - 1
		end if
		repeat with j from 1 to (cols)
			tell session sessid of current tab of current window
				split vertically with default profile
			end tell
		end repeat
	end repeat
	-- Execute actions
	repeat with i from 1 to num_actions
		tell session i of current tab of current window
			write text (action of item i of actions)
		end tell
	end repeat
end tell

Then, you just have to call the script directly:

# osascript multi-panes.scpt

And here is what you’re getting:

Feel free to add/remove/update the actions as needed!

Question ? Contact