Saturday, July 2, 2016

Basic tech instructions:

1. You can run a webserver on your local computer with no setup involved if you have Python installed - just run this command from the command line / terminal (from the folder you want the web server to serve up files from):
python -m SimpleHTTPServer 80
Where 80 is the port number. 80 is the normal web browsing port, but you can use other numbers if you want.
(10 Jan, 2016): I dont know how many people following this use linux, but if you have Python installed, you can start a very simple web server with one command: http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python

Then if you want to share it outside your network, it's just a matter of going into your router and setting up a port mapping (possibly also messing with your OS firewall rules).

I think I might do this - I've posted some really cool stuff on FB, but its too hard to find a specific thing in my history. I need to keep all the project stuff in one place.

(Note python-weboob: library for making a web browser from scratch...dad mentioned it, so I'll check it out later)

2. (5 March, 2016) One of the really cool things about open source is that there are sites where you can share your code. Most people use Github. Along with Github, there's a program called git which allows you to easily (once you get used to it) get a copy of any repository (the name for a project/folder of code) on Github (most people leave them public because you have to pay to make it private, at least on Github, although git does support you having your code wherever you want it).
So now I'm setting up a Github repository under my user ID DiginessForever called randomCode (for bits and pieces that are useful - will make more repositories for specialized purposes). So, the url will be https://github.com/DiginessForever/randomCode
-- One weird thing about git is that a "pull request" is actually when you send your code back up to a repository after making changes - then whoever is admin will use the merge tool to check your changes, and if they like them, pull them into the master branch. Git is probably one of the best source control programs to learn.
-- This is a tutorial on how to use Github's web interface to manage a repository on the site. You would still have to learn a few commands for your git client (GUI or command line/terminal - I use Linux terminal) https://guides.github.com/activities/hello-world/
-- Relevant tutorial commands (commands for terminal in quotes, but don't include outer quotes when entering commands: 1. Make a new file, edit it / save the changes. 2. Enter this command from the folder you want to be the repository: "git init". 3. "Git add ". 4. "Git commit -m "". 5. (only have to do this once) "git remote add origin https://www.github.com/DiginessForever/randomCode.git" (or whatever the git master repository url is). 6. Commit your changes: "git push -u origin master". Note: When I changed a file, I had to add it again in order to be able to push.
-- In closing, I'd like to point out that if you ever program anything, just take my advice - a source control program like git is absolutely necessary, don't try to do a project without it. Get started with source control early - keep all your work forever (and be able to see every change / whole history of file). Keep basic functionality out at a public site. That way, no matter what, as you switch jobs, you have your foundation that you take with you (can quickly build on top / don't have to recreate the wheel).

3. Walmart has released a tool called OneOps. Basically, a company can have an internal cloud / run this tool on top of it (lets you start up virtual machines without worrying about which computers are up or down). It also runs on a bunch of different cloud providers, so you can scale up really fast.
http://arstechnica.com/information-technology/2016/01/a-new-open-source-cloud-management-tool-from-walmart/
4. PapaParse provides a nice way to import comma separated files and automatically put it into an array with key-value pairs.
The keys are the words in the first row of the file. Summing up all the values in a column (if they are numbers) is as easy as a for loop using the loop counter and the name of the column header.
https://github.com/DiginessForever/randomCode/blob/master/Javascript/IPsort.html
5. I tried out TestDisk last night (a Linux data recovery tool). It's included in the Gparted Live CD (Gparted is a tool that lets you repartition your hard disks, and a Live CD lets you boot directly into it and run off the USB or CD so you're not relying on the operating system on disk).

Lessons learned:
a. You can often get back deleted files that aren't written over - seems to be about 50% effective. I think the tool is looking for old partition table records, then finding the files based on those. I recovered a few old files from a long time ago (Windows app installers). I did NOT recover my PGP key. I think that might have been because the partition record for that one may have been overwritten by one of my newer partition tables.

b. Gparted Live CD does not include Photorec - which would have been my next attempted utility. That one tries to find files based on "signatures". I haven't tried used it yet.

c. It took about an hour to do a deep scan on a 16GB partition.

16 Jul, 2015:
Houston, FPGA is a go. Adaptec Parallella has arrived. Burning SDcard now...hehe
Wow, they have code examples for the Epiphany chip from the US Army Research Lab.
This has the instructions for making / installing the sdcard image: https://github.com/parallella/pubuntu
This is so cool: "The codes were developed by the US Army Research Laboratory, Computational Sciences Division, Computing Architectures Branch." https://github.com/parallella/mpi-epiphany
Looks like the current Ubuntu setup for it isn't quite complete. Lots of configuration left to do. It's new from the last time I checked the site though.

-------- 11 Apr, 2015:
Loading Tails OS:
Well, got the opportunity to create another boot disk, this time a live USB for the Tails OS. It auto uses Tor in addition to spoofing mac address and having other encryption such as TrueCrypt and OpenPGP (standard on Linux). Funny part of it is that it fakes the look of Windows 8 as far as the desktop appearance goes if you select that option on bootup. It's quite a bit slower running it on the USB. I'm not completely certain that the security benefit of it being on USB only is worth the trade-off in speed, but it's nice to know that it's completely portable / runs from just what it has on that.

The install was very easy - just download the OS image from the distro site, then open a terminal and type a couple commands:

1. "sudo umount /dev/sdb"
2. "sudo dd if=/home//Downloads/image_file.iso of=/dev/sdb"


It copies from the downloads folder to the USB. When done, just type "sudo shutdown -r now" to restart immediately. It boots up in the Tails OS.

--I'm kind of embarrassed it took me so long to get a computer back up and running after I had the issue with my last OS instance. My wife's computer also had OS problems due to a bug in Microsoft's update process, so hers is dead right now too. Goodbye Windows! I think she'll really like Linux after the initial slight learning curve. So much less in the way of problems.

-- You'll have to change the above two things about command #2 above: your username (where is), and "image_file.iso" to match the name of the OS image you downloaded. Typically when you plug in a USB flash drive, it comes up on /dev/sdb - if it's got partitions, then those show up at /dev/sdb1, /dev/sdb2, etc. Those won't matter because when you use dd (disk dupe), it copies over everything, so no more partitions.

--------

8 Feb, 2015:
The question of how to handle data backups has been asked so many times on Slashdot. Just saw this on the LinuxJournal website - it's a perfect answer to the question.

http://zbackup.org/

The reason for this is that it handles full and incremental backups easily. You'd still have to make sure that your hardware is fault tolerant (RAID or keeping two copies of the backup to compare), as screwing up a bit of data could make the restore fail.

No comments:

Post a Comment