One common task that we always have to do relatively often is to find the location of some specific files. Although you may have some clues that those files are located in your current working directory, “.” symbolic link used in the command below, you may have no clue to which sub-folder your files are.
May be you are working on a sensitive data, or just want to secure your personal data on your personal computers. Mac offers the whole hard disk encryption when you install the system, as well as, encryption of your backup through “Time Machine”. However, there are times that you might want to add an extra security to your file. May be you save some of the files to Dropbox or Google Drive, and the file might contain your personal health information that you would not want just anyone to be able to simply read it.
There’s a simple tool in OsX that can help you do this.
zip -e [output.zip] [file-to-be-encrypt]
zip utility will ask you to create a password. The stronger the password. The harder it will be to crack it. However, make sure you will remember the password, too. For this reason, I recommend you to use a password manager, e.g. LastPass is one of an excellent and easy to use tool with several browser integration for both mobile device and personal computer.
Just for the peace of mind. The encryption algorithm in zip might not be very strong. But at least, you save some disk space, and there’s one more extra-security of a password protection that you have to go through before accessing the content of the file.
Getting the Linux Image
Convert iso to img
hdiutil convert -format UDRW -o ubuntu-16.04-server-amd64.img ubuntu-16.04-server-amd64.iso
man hdiutil for detail about the command
Create a bootable USB drive
- plug the USB drive into your computer and find out which mount point it is mounted to.
This will show the list of all drives mounted to your system right now. The description of which drive is a UBS drive should be quite clear.
– Unmount the disk before we proceed to write a bootable image on it.
# unmount it diskutil unmount /dev/disk2
- copy the disk image to your usb drive.
sudo dd if=ubuntu-16.04-server-amd64.img.dmg of=/dev/rdisk2 bs=1m
/dev/rdisk2 instead of
/dev/disk2, you are writing the raw data to the USB drive which will be several folds faster than writing through the buffered
Eject the USB drive
- After writing the image, a diaglog box will alert you that the disk is not readable. Simple eject the disk.
- Alternatively, at the command
diskutil eject /dev/disk2
- Restart the Mac while holding down the Option key, and double-click the icon for the Recovery partition. …
- Choose Utilities > Terminal.
- In Terminal, type resetpassword .
- Reboot your computer.
- Hold Shift during boot to start GRUB menu.
- Highlight your image and press E to edit.
- Find the line starting with “linux” and append rw init=/bin/bash at the end of that line.
- Press Ctrl + X to boot.
- Type in passwd username.
- Set your password.
Again working behind firewall through proxy server is sometimes troublesome.
normally, you can export “http_proxy” to set a proxy for most process. However, to install software with apt-get, if the previous method doesn’t work.
I bought a MacBook pro for work because of the similarity between Linux terminal and Mac terminal. However, if this is the only justification for buying a macbook, I should have thought again.
Superficially, OsX and Linux might look similar. However, the libraries, packages, machinery inside is very different. For example, there is no “wget” on Mac. Then, how can I download anything through a terminal. One solution after probing around that I came up with a while ago was to use “homebrew”
I’m not going to cover the installation of homebrew here, but
If you are behind a proxy server, to install wget
$ sudo http_proxy=http://proxyUser:proxyPassword@proxyServer:port brew install wget
You can find more detail about using homebrew at https://github.com/Homebrew/homebrew/blob/master/Library/Contributions/manpages/brew.1.md
I'm trying to install CNVWorkshop (cnv.chop.edu), but now facing problem of running Ubuntu 10.10 which has faced the end-of-life since April 2013. So, now running "sudo apt-get install" anything would not work, since the repo was set to look for files from archive.ubuntu.com. AAfter spending sometimes 'google' as usual, here's where I end up. Not that I intended not to upgrade to a newer release, but this is probably a relatively faster way to deploy another software that I still need to use. sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.listsudo apt-get update && sudo apt-get dist-upgrade