Igor's Blog

I've been looking at some data in CSV files that unfortunately had commas within quotes, signifying that those commas should not be used as field delimiters. Since I was doing this on macOS, I've come across an issue with the macOS awk command in that it doesn't support the FPAT feature of gawk which makes it easy to split data by content using regex. Then I came across this article that really helped with my use case.

What I wanted to do was turn a CSV file that had data like this:
 Input CSV File
1,2,"3,4",5
1,2,3,4,5


...into something more usable for me like this:
 Output PSV File
1|2|3,4|5
1|2|3|4|5


Using the last example in the article I've linked to above I came up with a script to convert the CSV file (with commas in quotes) to a pipe separated file (PSV). With a bit of Bash and Awk, the code looks like this:
 Bash and Awk
INPUT_CSV_FILE="input_file.csv"
OUTPUT_PSV_FILE="output_file.txt"
awk 'BEGIN { l=0 }
{
c=0
$0=$0","
while($0) {
match($0,/ *"[^"]*" *,|[^,]*,/)
f=substr($0,RSTART,RLENGTH)
gsub(/^ *"?|"? *,$/,"",f)
c++
if (c == 1 && l > 0) printf "\n"
if (c > 1) printf "|"
printf("%s", f)
l++
$0=substr($0,RLENGTH+1)
}
}' "$INPUT_CSV_FILE" > "$OUTPUT_PSV_FILE"


It's a bit ugly, but it works.

[Read More and Comment]  

, , ,

If you're using Fancybox with dynamic image URLs, you may find that the gallery/full screen pop-up is not working. Instead of the pop-up, when clicked, the source image is being loaded in the window as if Fancybox wasn't initialised. This is because Fancybox hasn't been able to determine the image type so doesn't know what to do. It's easily rectified.

For example, URLs like this will cause this issue to surface: http://<some_domain>/image.php?id=1234

To allow these types of URLs to work, simply add this parameter to your Fancybox initialisation:
 Option
type: 'image'


For example, this is what my Fancybox initialisation looks like:
 JavaScript
$('.fancybox').fancybox({
padding: 6,
nextClick: true,
helpers: {
overlay: {
locked: false
}
},
type: 'image'
});


That's all there is to it!

[Read More and Comment]  

, , ,

I've created the jQuery UI Photoboxr plugin while working on Travel µBlog so that I could easily display panoramic photos in 4:3 aspect ratio boxes. Over the weekend I've updated Photoboxr to version 0.2.

This update brings a new, slick UI to the plugin and changes scroll calculations to be pixel based rather than percentage based. The pixel based calculations ensure that the clipping box doesn't show through when images are scrolled to their extreme left/right positions.

New icons make it easier to see what's going with clearer (I hope) horizontal/vertical indicators. The FancyBox expand indicator has also been revamped to cover more space while obstructing the underlying image less (by using a semi-transparent overlay).

Here's what the plugin looks like now:
photoboxr0_2.jpg


Release 0.2 can be downloaded from Github here.

[Read More and Comment]  

, , , ,

This is a guest post written by Tej Pratap Shukla, a Server Administrator from New Delhi, if you like the article, be sure to visit Office 365 Tips. Without further delay, over to Tej...

In this post, how one can add disclaimer to all outgoing emails in Office 365/Exchange Online manually without any expert is discussed. One just simply needs to follow the method and add disclaimer to the emails to ensure security, confidentially, the liability of email content.

Email is the important business tool used by many organizations. However, using emails without any signature and disclaimer is like giving an invitation to the number of legal threats. Therefore, from the security point of view, it is important to attach a disclaimer to every outgoing email from Office 365/O365. Now, what exactly is email disclaimer? It is the statement that is added to all emails sent from a particular organization. It is usually added to disclaim liability or marketing purpose as well. Moreover, the disclaimer statements are mainly of legal characters drafted by the legal department of an organization. Now, to make it more easy for IT administrator, these disclaimers can be managed through central location also and can be added to each email automatically using Office 365 Transport rules. These IT administrators can easily manage Office 365 Admin accounts from a single panel using a third-party service. After understanding the main reason behind applying a disclaimer, method of how to add disclaimer to all emails in Exchange Online is discussed.

An Example of Disclaimer:
The content of this email is confidential and only for the recipient that is specified in the message. It is strictly prohibited to share any content of this email message with any of the third party, without having a written consent provided by the sender. In case you received this message by mistake, then please reply back to this message and delete it from your system immediately, so that we can make sure that all such type of mistakes does not encounter in the future.


Why Add Disclaimer to All Outgoing Emails in Office 365?

Everyone has a different reason behind adding disclaimer to emails in Exchange Online. Therefore, in this section of the post, all possible reasons to apply for a disclaimer are sum up:

  • Legal Protection - Email disclaimer provides all type of legal protection to an organization. Any type of confidentiality, security, liability, entering into contracts, misstatement issue can easily be avoided using a disclaimer in the email message. Moreover, it also prevents the actual occurrence of legal proceeding against an organization.
  • Marketing Purposes - Another main motive of attaching a disclaimer is that it help in the marketing of an organization. One just needs to add an organization’s address, URL to the disclaimer. For example, it is also helpful in adding a footnote that contains a new coming fundraising or outreach campaign.
  • Regulatory Compliance - In order to prevent the client privacy, the new and existing regulations are used. Moreover, it is also used to keep the record of email communications and ensure the secure confidentiality of information. Thus, to accomplish all this, it is necessary for an organization to add disclaimers at the bottom of their emails to make sure the integrity of their patients or clients and to overcome any confidentiality failures.


Method to Add Disclaimer to All Outgoing Emails in Office 365

In order to add Exchange Online disclaimer signature, one can make use of Office 365 Transport Rule. Follow the steps mentioned below to create a disclaimer that is added to the bottom of all emails sent from an organization:

  1. Open Exchange Control Panel and choose the Manage My Organization >> Mail Control >> Rules option
disclaimero365_1.png


[Read More and Comment]  

, , ,
 
Programming, DIY, Games, Hacks, and Tech

Recent Blog Posts

Converting a CSV file containing commas in quotes to a pipe separated file using Awk and Bash

How to get Facybox gallery popup to work for images with dynamic URLs

jQuery UI Photoboxr plugin updated to version 0.2

Learn How to Add Disclaimer to All Outgoing Emails in Office 365

How to securely host your web site for free with Google Cloud and CloudFlare (part 3)

How to securely host your web site for free with Google Cloud and CloudFlare (part 2)

How to securely host your web site for free with Google Cloud and CloudFlare (part 1)

Beware of the subtle difference in date format strings between MySQL and SQLite

Postman reporting Unexpected 'N' error in response body

Adding extra shelves to the Ikea Detolf display cabinet

Recent Galleries

Space Food - Chocolate Ice Cream with Chocolate Chips

Legeod Star Wars AT-DP kit

DIY spare parts computer build with a RAIDMAX Anura case

Fake 'Lepin' brand Lego packaging

Hardwood garden bench with clear resin void filler

Fixing a 3D printer extruder that stopped heating up

Easily increase disk space in a Lenovo Ideapad 100S 14" laptop with an M.2 SSD

Making a multi-piece 3D printed solder spool holder stand

DIY indoor apartment grow light wiring

Good Friday Electronics fun Easter Bunny LED PCB Kit IBEABU-01.0

My Other Web Sites

Igor and Elise's Travels
Riverside Expressway Cam
300 George St Blogumentary

My Online Tools

UUID to OID Converter
Guru JSON-RPC Tester
Extrudifier Object Designer
Travel µBlog

Blogs and Friends

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity
Please follow me for more great content!
     
Don't show this again