Installing two computer languages G++ and Ruby

Ok, here we are again. learning how to use some certain programs like C++ and Java,  First we make sure that we are all up to date. with the sudo apt-get update command, then we use sudo apt-get (-y)install g++  the y is there to skip asking the question Y for yes n for no. I always forget it and end up pressing it anyway. installing g++

and now you can use it: I put in hello world,  Thanks Tero for the code  simple code  but first i put in sudoedit hello.cc ( to make sure that it would be saved as a c program, as you can see the various colours showing up on the screen for various commands

#include <iostream>
 
int main()
{
    std::cout << "Hello, world!" << std::endl;
    return 0;
}

helloworld.png

I did use nano to try it first but wouldn’t save so as per above instruction i used sudoedit,  then put in the command

g++ hello.cc -o hello  but got errors.
 
errorc++.png
hello.cc: In function ‘int main()’:
hello.cc:6:1: error: expected primary-expression before ‘return’
 return 0;
 ^
hello.cc:6:1: error: expected ‘;’ before ‘return’
henry@henry-HP-Pavilion-15-Notebook-PC:~$ sudoedit hello.cc
I cant see the error problem.. working on it.

I tried to install basic: sudo apt-get yabasic 
henry@henry-HP-Pavilion-15-Notebook-PC:~$ sudo apt-get install yabasic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package yabasic
henry@henry-HP-Pavilion-15-Notebook-PC:~$ yabasic 
yabasic: command not found
henry@henry-HP-Pavilion-15-Notebook-PC:~$ yabasic 
yabasic: command not found

but as you can see command not found. I have connection but no basic. 


So I'm going to install ruby instead:
rubyfull.png'm going to try Ruby instead,

henry@henry-HP-Pavilion-15-Notebook-PC:~$ ruby 
print ("hello Ruby World!\n")
hello Ruby World!
henry@henry-HP-Pavilion-15-Notebook-PC:~$ 
--It works


Setting up an Apache server take 2

So I decided to start all over again, (well not completely all over again) the public_html directory is still there from last time and so is the index.html.

I figure it was easier so first I got the apache screen .

Don’t forget to update your depositories, i forgot to add it here.

apache2welcome

By installing sudo apt-get -y  install apache2 again

then editing the .conf file  by going to this directory and using sudoedit /etc/apache2/sites-available/henry.conf  <- the name of my pc is henery..

then enabling the ‘said’ .conf by first creating  henry.conf and adding these lines to the .conf ctrl+x and y to save.

## /etc/apache2/sites-enabled/henry.conf

<VirtualHost *:80>
 DocumentRoot /home/henry/public_html/

 <Directory /home/henry/public_html/>
   Require all granted
 </Directory>
</VirtualHost> in the black box. ctrl-x and y to save.

which is done by sudoedit /etc/apache2/sites-available/henry.conf

 

and disabling the 000-default.conf  then, reloading the server my sudo service apache2 reload, according to the instructions of the screen. then the restarting of the server too.

done by

$ sudo a2ensite henry.conf
$ sudo a2dissite 000-default.confn 
restarting the apache server 

Screenshot - 04.03.2016 - 18.07.33
Checking my log files under /var/log/apache2/error.log gave us this..
error.log
  But the execute rights were not enabled for the apache2 server . 
check home/henry/public_html using the command -ls -l there you can see the 
read/write permissions.
They were not executable, or just read (must get more information on that!) 
the reason why i did the command a twice or three times was to get a clear picture.
and not it works, I Left out the part that i made a /public_html/index.html file. 
but that was in my first encounter with this apache server. but if you need to 
know how to make that mkdir /public_dir in the /home/henry/file so it looks like 
//home/henry/public_html/... and of course we make a page too index.html via
nano. Gave us this Thanks again, Tero for finding the error.  
 hellohellohello
Thanks again Tero for the help looking at my work with and finding 
the error so promptly.

An HTML5 Homepage  part 2 of this homework

the Hello hello hello, only last for a while. so its time to change it. to something useful. Enter html5

<!doctype html>
<html>
<head>
	<title>Henry's Test Page</title>
	<meta charset="utf-8" />
</head>
<body>
	<h1>Henry's Test Page</h1>
	<p>Let's test UTF-8 with "päivää"</p>
	<p>See you at <a href="http://TeroKarvinen.com">TeroKarvinen.com</a></p>
</body>
</html>
henrys testpage and Teros Karvinen's website.. then recycle or as i did, 
sudo service apache2 reload (but im sure if you reloaded the page
 It would of been easier.
Next we validate the page by checking it with https://validator.w3.org/ open up 
the third tab and paste the html code into it. press the check button and presto. Its ok.
Thats it.. your finished these were found in 
http://terokarvinen.com

Setting up Apache webserver

today we learned in class how to set up Apache webserver. Hopefully for homework i can reproduce the results, First one must update everything  using sudo apt-get update. this will ensure that everything is up to date before installing apache2. next command will be sudo apt-get install apache2 when that is done you can check if its working or not by simply going to an empty website and pasting the http://localhost at first you should see nothing, but then after apache2 installation you should see a webpage hosted my apache.. Now we can start.

                        1. we create a virtual host we I, was following my lecturer  Tero Karvinen, who is our lecturer. we were doing this by going into the directory
                        2. $ sudoedit /etc/apache2/sites-available/YOURNAME.conf  (this is the quick way,) and using the sudoedit command as you can see or you can use the cp command and copy the 000-default.conf and calling it YOURNAME.conf then doing a sudoedit YOURNAME.conf (the way i did it) and getting rid of all the #’s  P.S. I was stuck on this for a while..the reason why i did it the slow way was i wanted to do it one step at a time. 000-configchanging the document root to /home/yourname/public_htm also adding <Directory /home/YOURNAME/public_html/
                        3. so it looks like this
                          ## /etc/apache2/sites-enabled/YOURNAME.conf
                          <VirtualHost *:80>
                           DocumentRoot /home/YOURNAME/public_html/
                        4.  <Directory /home/YOURNAME/public_html/> add this 
                             Require all granted add this 
                           </Directory>
                          </VirtualHost>
                        5. gearoid.conf
                        6. call it something simple as you may have to write it out alot.Save it as YOURNAME.conf
                        7. Done, the first part now you must swap out the 000.default.conf to YOURNAME.conf this is done by using these two commands
                          $ sudo a2ensite YOURNAME.conf
                          $ sudo a2dissite 000-default.conf

                          I had difficulty doing this as it kept on saying that it didn’t exist even though when i typed ls and saw both 000-default and YOURNAME.conf, was there, still didn’t work.. P.S. these are all now in the sites-enabled directory. then I changed YOURNAME.conf into the sites-available and tried it again and it worked. this took me awhile to figure out don’t forget to restart the webserver, using this command

                          $ sudo service apache2 restart but when you finish
                        8. the previous step the command prompt gives you a different command something i cant find at the moment. when you run that you should get some errors as you don’t have a website yet ah0012error
                        9. those were AH00112 Warning DocumentRoot [/home/gearoid/public_html does not exist and AH00558 apache2: could not reliably determine the server’s fully qualified domain. I checked these errors by going to the /var/log/apache2/error.log see the screen belowErrorlog
                          
                          

                          These are normal as i didn’t make a webpage. So back to the command prompt to make a site or page.

 

 

  • cd to go home
    $ mkdir public_html/ this is were i made a mistake 
    $ cd public_html/ <- watch the slash, i didn't put it in
    $ pwd
    /home/YOURNAME/public_html/ now you should have a directory
  • now run the apache commands again it should work..
  • …But not for me as i refreshed it i got an error stating that firefox couldn’t find the page (page not found). I moved it out from where it was (the public_html folder) and then refreshed the page and Apache, now it works but its skipping a directory.the public_html folder ..I’m wondering why? It was staring me in the face Tero even said it…using the pwd command i compared the paths in the command prompt after making /home/YOURNAME/public_html/ and it didnt match, I then copied and pasted the “right” one into my .conf file and reset the apache server and now it works… retested it. now it doesnt work again, says forbidden I checked out this error stating
  • AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message I got rid of this message by editing the apache2.conf file Edit Apache2 conf file : vim /etc/apache2/apache2.conf this gets rid of the error, but still doesn’t work So I reset it back to where it was in search of an other solution checking the errors again
  • 3)Permission denied: [client 127.0.0.1:40069] AH00035: access to / denied (filesystem path ‘/home/gearoid/public_html’) because search permissions are missing on a component of the path according to the /var/log/apache2/error.log  according to IT blah  its rare but sometimes appears, horray for me! i’m the lucky one..
  • http://www.itblah.com/apache-ah00035-access-file-denied-filesystem-path-path-search-permissions-missing-component-path/
  • Day two, after doing some light study on the project and being cajoled into using the chmod  command, i caved in
  • chmod –help’ for more information.
    gearoid@gearoidPC:~$ chmod -R 775 /home/gearoid/public_html and it didn’t work
  • (Aside- 7-03-2016 Pls be careful using this command as this user changed the settings all the way up and couldn’t log into his pc this wasn’t the code that did it. I had to make a new user and change the settings again in order to get back in On retrospect it was a good learning experience but at the time, I almost re-installed ubuntu.)
  • starting from the start so.. line one, apt-get update ( yes i forgot the sudo!)

next sudo apt-get install apache  -y  (yes it did work)   then ran the local host and got the congratulations webpage, or welcome to apache server..

Creating your virtual server, Go to /etc/apache2/sites-enabled/henry.conf

## /etc/apache2/sites-enabled/tero.conf
<VirtualHost *:80>
 DocumentRoot /home/tero/public_html/

 <Directory /home/tero/public_html/>
   Require all granted
 </Directory>
</VirtualHost>

Since that all didn't work i read in a site created a httpd.conf and 
aadded a single line txt servername  (tab) localhost 
ssaved file /etc/apache2/httpd.conf
tthen I added an entry in the apache.con f on the last line to
 to enclude the httpd.conf and now having the error 
Permission denied: [client 127.0.0.1:46032] AH00035:
 access to / denied (filesystem path
 '/home/henry/public_html') because search
 permissions are missing on a component of the path
 
Still no luck on getting this server working.
Ok I decided to restart, so Im starting in a new blog. 

See Setting up an Apache server take 2

Installing three programs

 

 

Now, for this homework (for me) was to choose three programs and install them since we were learning how to use apt-get command last week i might as well stick with it and see what happens.

Referring back  to classes I’m going to choose from the ‘useful packages’ pile.

so  Inkscape,  libre office, and gedit.

I first checked out Inkscape, as usually one needs an address to install it from.  I checked it out

I first did an apt-get update  -> making sure everything is up to date,

http://wiki.inkscape.org/wiki/index.php/Installing_Inkscape found  out that i didn’t or shouldn’t bothered as it was just apt-get install inkscape. which was nice, I’m beginning to really like this command line, its now as easy or easier than going to a package manager. For those of you who don’t know what Inkscape is. Its a drawing package.

Next Libreoffice

First i had to well..according to the website

http://libre-software.net/how-to-install-libreoffice-on-ubuntu-linux-mint/

to install the libre office (or old ones) it was an other command that i had not used, So i figure if its not going to do anything. What is the harm.

sudo apt-get remove libreoffice-core

sudo apt-get remove --purge libreoffice-core so now that everything is removed (I had x amount not removed x amount not deleted) then I put in apt-get install libreoffice.

If you’re using Ubuntu (Gnome) use this command: sudo apt-get install libreoffice-gnome-https://wiki.ubuntu.com/LibreOffice

I also had to install the gnome for the desktop integration, two steps. I'm finally beginning to really like this method of installation

the last program i wanted to install was gedit for the gnome eniroment, I had to check to see if i had it first but didn’t The helpful people in xubuntu said this get it

it was as simple as that.. I also installed a program called yum, which i needed to use to install virtual box, its a sandbox for other operating systems. yum went easily in (wish it was my mastery of  linux commands, but it turned out that my pc is smarter than me. it offered help in the guise of “If you want to install yum use this command. and presto its in. It had a grapical (4bit) interface as you can see.yum.png

Now I must continue my journey to install virtual box  I didnt need the yum command apt-get works too. So i went with what i know. apt-get install virtualBox-5.0 But then there were problems. not installed.png

work continues..

 

Now I must try a drawing package as an added extra  I wouldn’t of made it this far and enjoy it so much if my lecturer didn’t show me the way Thanks again Tero http://terokarvinen.com/2016/agenda-for-linux-basics-dat8tf063-27-spring-2016 and his linux classes. The extra assignment was to draw with a drawing program, I chose the one that i downloaded via apt-get, inkscapeinkscape

I won’t be winning any prizes at any art fairs any time soon but inkscape is so easy to use.

Extra task check out errors, the one time that i didn’t have any

Trying out the errors. log is in the  im looking in the /var/log/apt/ install.log taillog.png

I tried to put cat and tail together, thought it would be funny to have a cattail command ..didn’t work.  this shows the apt-get command and times, Start date for installing apache2 <-program and the various packages that was needed with it. i also took a syslog picture, I have no idea whats going on in that.syslog.png

I can just see the time and what manager or program was being used or using the command at that time, for example Network manager [782] but this means nothing to me.

 

Using simple commands in Linux

Today I’m going to be using some simple commands in linux in the command box: rm  I started by creating a directory called linuxsandbox for safety reasons: the command I used for that was mkdir l…sandbox, there I put in 4-5 directories, by making them in the same way.Screenshot from 2016-02-04 14:51:11.png

Here I used the command rm command for remove but I couldn’t remove them as they were directories. but when I put in rm -r then I could remove the said directory. same in example below I tried to remove all junk files by using junk*

mkdir

Screenshot from 2016-02-04 14:58:35.png

By using -r after the command and pressing ‘y’ for yes as one of the files was write protected. it deleted everything with 1 in front of it  4 remains…

I also used the help button that is used by using a command and help  using Screenshot from 2016-02-04 15:03:13

typing in help in the command prompt, bring up all the commands whereas pressing a command and –help  will give you all the possibilities, mind you –h doesn’t work

gearoid@debian5:~/linuxsandbox$ ls –h
ls: option ‘–h’ is ambiguous; possibilities: ‘–human-readable’ ‘–help’ ‘–hide’ ‘–hide-control-chars’
Try ‘ls –help’ for more information.
gearoid@debian5:~/linuxsandbox$

the next command is  $ ls /etc |less  -> the less part this  takes and prints veeerry long files and puts them into page size pieces Screenshot from 2016-02-04 15:54:42.png

But I dont know how to get out of this.. I press exit or esc. and  pause zz or uparrow and zz to getout

The last command that I have to tell you about is the keyboard setting for various languages if you live in a country that isn’t English speaking or English typing..then you have to learn this one  Setxkbmap and the country code i.e. fi for a Finnish keyboard.. es for a Spanish board and so on.. Thanks for listening or learning..

This is all possible by our lecturer Tero Karvinen -Thanks Tero http://terokarvinen.com/2016/agenda-for-linux-basics-dat8tf063-27-spring-2016

Switching from Windows 7 to Debian Or Ubuntu.

In this blog I’m trying to find a replacement for all the windows 7 utilities that have on my p.c.

I’m not going to put in what kind of pc I have just the operating system, whati have

They are in Alphabetical order: I figure its easier to see when written: Plus the links are the closest that I found when swapping over to Debian, some of the programs stay the same (or have the same name,) some require some tinkering, whilst others change program totally. I also have put in some blogs, that can help in sorting out various problems. when solving these problem I simply put the “(insert program here) and then Debian” after it..and got these results, If lucky if not then research was needed to find out the equivalent.

7 Zip 15.6 beta (x64x) file managemnt program     p7zip for Debian (and Ubuntu)

NJ LAN usb adaptor Netwjork,  https://help.ubuntu.com/community/WifiDocs/Driver/prism2_usb

Airport Time capsule   http://blog.martinshouse.com/2014/09/mounting-apple-time-capsule-share-from.html

Apple Application support 32,

Apple application support  64,

Apple mobile device support,

Apple software update,

Asmedia Asm 106x Sata Host Controller Drvier,  Asmedia Asm 106x Sata Host Controller Drvier

AVG Protection, Anti virus   http://free.avg.com/ww-en/129024

AVG Web Tuneup, Anti virus tuneup This is done via the web browser see below Linux doesn’t have any viruses in the wild.

Bonjour, LAN software for apple   http://www.acmesystems.it/bonjour steps to take to install.

Citrix Reciever, Virtual Desktop  https://www.citrix.com/downloads/citrix-receiver/legacy-receiver-for-linux/receiver-for-linux-131.html

Dropbox, Cloud storage   https://www.dropbox.com/install?os=lnx

Git Version 2.7.0,  Git repository https://packages.debian.org/search?keywords=git

Github, Git repository hosting service  https://github.com/Debian

Google chrome, Browsing internet page  https://www.google.com/linuxrepositories/

Gpg4win (2,3,0) is an email and file encryption package for most versions of Microsoft Windows.  keyring.debian.org

Icloud, storage.. Just use any browser doesn’t need any special depositories

Itunes, Music player, Amarok

It seems by now that if you have all the same programs to start with, why are you changing operating systems? But the list isn’t finished yet

 

java 8 update 71,    http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

linuxlive USB Creator, its the same or  http://unetbootin.github.io/

McAfee Live safe internet security, There are no viruses in the wild in linux.

Mediamonkey 4,1,   Music player  ->Amarok

MS net framework 4.5.2, web installer ->  synaptic

MS Office 365 proplus en-us, office tools -> Libre office

MS Office Proofing tools English, Libre office extensions http://extensions.libreoffice.org/extension-center/languagetool

MS Office Tarkistustyökalut 2013 suomi,  http://extensions.libreoffice.org/extension-center/finnish-spell-checker-and-hyphenator-voikko

Mozila firefox 43,0,4   web browser -> iceweasel https://packages.debian.org/search?keywords=iceweasel

Mozilla  Maintenance service Web browser update tool-> iceweasel same post as above as it will download the latest updates

Nvidia 3D vision Controller driver 340,50  wiki.debian.org/NvidiaGraphicsDrivers

Nvidia 3D vision Driver 341,92, 3d graphics Driver

Nvidia Geforce Experience 2,2,2 Graphics Driver

Nvidia Graphics Driver 341,92 Graphics Driver

Nvidia PhysX System Software 9,13,1220, graphics Driver

Oracle Vm Virtualbox 5,0,12,  virtual machine  -> Virtualbox https://www.virtualbox.org/wiki/Linux_Downloads

Plex media player,  video player  VLC https://www.howtoinstall.co/en/debian/jessie/main/vlc/ apt-get install vlc

Quicktime 7,  movie player  VLC see above

Realtek Ethernet Controller Driver, software installer synaptic

Remotr Driver 1,2,1198, remote display -> Apache

Ruby 2,2,3,  computer language  Ruby List of contents 

Screenshot from 2016-01-28 18:36:19

that was cheese photograph and GNU image manipulation program.

This is all possible by our lecturer Tero Karvinen -Thanks Tero http://terokarvinen.com/2016/agenda-for-linux-basics-dat8tf063-27-spring-2016

 

 

 

 

create very detailed hardware report

Starting with sudo lshw -short -sanitize  I put this into my command box, and….sudo pw as seen below..

gearoid@debian5:~$ sudo lshw -short -sanitize
[sudo] password for gearoid:
H/W path               Device      Class          Description
=============================================================
system         Computer
/0                                 bus            Motherboard
/0/0                               memory         6865MiB System memory
/0/1                               processor      AMD A8-6410 APU with AMD Radeon R5 Gr
/0/100                             bridge         Advanced Micro Devices, Inc. [AMD]
/0/100/1                           display        Mullins [Radeon R4/R5 Graphics]
/0/100/1.1                         multimedia     Kabini HDMI/DP Audio
/0/100/2.1                         bridge         Family 16h Processor Functions 5:1
/0/100/2.1/0                       display        Topaz XT [Radeon R7 M260/M265]
/0/100/2.2                         bridge         Family 16h Processor Functions 5:1
/0/100/2.2/0           wlan0       network        RTL8723BE PCIe Wireless Network Adapt
/0/100/2.3                         bridge         Family 16h Processor Functions 5:1
/0/100/2.3/0           eth0        network        RTL8101E/RTL8102E PCI Express Fast Et
/0/100/2.5                         bridge         Family 16h Processor Functions 5:1
/0/100/2.5/0                       generic        RTS5229 PCI Express Card Reader
/0/100/8                           generic        Advanced Micro Devices, Inc. [AMD]
/0/100/10                          bus            FCH USB XHCI Controller
/0/100/10/0            usb4        bus            xHCI Host Controller
/0/100/10/0/1          scsi2       storage        DataTraveler 3.0
/0/100/10/0/1/0.0.0    /dev/sdb    disk           7866MB SCSI Disk
/0/100/10/0/1/0.0.0/1  /dev/sdb1   volume         7498MiB Windows FAT volume
/0/100/10/1            usb3        bus            xHCI Host Controller
/0/100/11                          storage        FCH SATA Controller [AHCI mode]
/0/100/12                          bus            FCH USB EHCI Controller
/0/100/12/1            usb1        bus            EHCI Host Controller
/0/100/12/1/1                      bus            USB hub
/0/100/12/1/1/1                    input          Kensington Mouse-in-a-box
/0/100/12/1/1/3                    communication  Bluetooth Radio
/0/100/13                          bus            FCH USB EHCI Controller
/0/100/13/1            usb2        bus            EHCI Host Controller
/0/100/13/1/1                      bus            USB hub
/0/100/13/1/1/2                    multimedia     HP Truevision HD
/0/100/14                          bus            FCH SMBus Controller
/0/100/14.2                        multimedia     FCH Azalia Controller
/0/100/14.3                        bridge         FCH LPC Bridge
/0/101                             bridge         Advanced Micro Devices, Inc. [AMD]
/0/102                             bridge         Advanced Micro Devices, Inc. [AMD]
/0/103                             bridge         Advanced Micro Devices, Inc. [AMD]
/0/104                             bridge         Advanced Micro Devices, Inc. [AMD]
/0/105                             bridge         Advanced Micro Devices, Inc. [AMD]
/0/106                             bridge         Advanced Micro Devices, Inc. [AMD]
/0/107                             bridge         Advanced Micro Devices, Inc. [AMD]
/0/2                   scsi0       storage
/0/2/0.0.0             /dev/sda    disk           500GB ST500LT012-1DG14
/0/2/0.0.0/1                       volume         511MiB Windows FAT volume
/0/2/0.0.0/2           /dev/sda2   volume         244MiB EFI partition
/0/2/0.0.0/3           /dev/sda3   volume         465GiB LVM Physical Volume
/0/3                   scsi1       storage
/0/3/0.0.0             /dev/cdrom  disk           DVDRAM GU90N
gearoid@debian5:~$

 

Ok, starting part two, I should of checked this earlier, but couldn’t see it till now.

Noticing the # key I went into root mode and started typing.

#!/bin/bash
# machinocealla - store description of computer
 hardware and configuration
# usage: sudo machinotero
# (c) 2007 Tero Karvinen www.iki.fi/karvinen <- and 
thanking him for this code, so leaving as is.
gearoid@debian5:~$ su 
Password: 
root@debian5:/home/gearoid# !/bin/bash
bash: !/bin/bash: event not found
root@debian5:/home/gearoid# /bin/bash
root@debian5:/home/gearoid# machinegearoid -store description
 of computer hardware and configuration 
bash: machinegearoid: command not found
root@debian5:/home/gearoid# function r 
> {
> CMD=$*;
> echo -n "$CMD; ";
> echo -e "\n== $CMD ===" >> $OUT;
> $CMD >> $OUT 2>&1;
> }
root@debian5:/home/gearoid# function r  { CMD=$*; echo -n "$CMD; ";
 echo -e "\n== $CMD ===" >> $OUT; $CMD >> $OUT 2>&1; }
root@debian5:/home/gearoid# exit
exit
root@debian5:/home/gearoid# #!/bin/bash
root@debian5:/home/gearoid# #machinocealla -Store description of
 computer hardware and configuration
root@debian5:/home/gearoid# #usage:sudo machinocealla
root@debian5:/home/gearoid# 
I noticed that i made an error with the sudo command and corrected
tit from suto to sudo. was I meant to do this in a word type document?

But then i got the bright idea to do it in nano and so im typing...
some time later.....
just wondering if
fi was the finish language? 
plus every so often: I see this code and (now its clear but I
cant always tell if the 1 is an l or not,
f "[ -z $1 ]; then
	OUT=$HOST-$STARTED.txt;
else
	OUT=$1;"

plus using https://gearoidoceallachain.wordpress.com" >> $OUT instead of
echo "Machinotero http://www.iki.fi/karvinen/machinotero" >> $OUT
well we will see where it goes? 

also
*thunderbird* 915resolution* Is there a * missing? 
I wrote it out and tried to save it to machineocealla
I tried to save it to the bin/bash directory, but it didn't save
I I may have to bring in the whole pc in order to investigate

I couldn't get it working, More study is required..
Then I copied machinotero and copied it to a .txt file 
ran the code sudo bash tero.txt (this was all done in my
Documents folder, and this turned out..
Screenshot from 2016-01-26 19:18:51
Checking up the move command 
https://www.linux.com/learn/tutorials/758119-moving-files
-linux-commands-file-managers
I couldn't move it into the bin file as I didn't have root 
privileges, so trying an other way of doing it.
mv tero.txt /bin/tero.txt
mv: cannot move ‘tero.txt’ to ‘/bin/tero.txt’:
 Permission denied <- forgot sudo 
gearoid@debian5:~/Documents$ sudo mv tero.txt /bin/tero.txt
gearoid@debian5:~/Documents$
when it was moved  tried the command again sudo 
bash machinotero
again and the same 
Screenshot from 2016-01-26 20:04:33.png
AAt least i got the mv command down from moving machinotero
from Documents to the /bin/ file.. more study needed 
 
Then I discovered that I didn't use the command chmod
Screenshot from 2016-01-26 22:20:30
And setting rights 755 for read write and execute permission 
and 700 read and execute. then the sudo bash machinotero.
It works! but shows inocorrect data


Screenshot from 2016-01-26 23:55:11.png 
More work to find the problem..

This is all possible by our lecturer Tero Karvinen -Thanks Tero 
http://terokarvinen.com/2016/agenda-for-linux-basics-dat8tf063-27-spring-2016

 

Creating a Live USB stick via Debian 8

The aim of this experiment is to create a “live USB” stick.

Background information:

Laptop HP Pavilion AMD A8-6410 AP with 8 gb. ram with AMD Radeon R5 Graphics. running Debian 8.1 (Jessie)

USB Kingston DTSE9  8Gb <- added later,

Complements  Superuser.com. under What command you use to find out hardware info?…  So its a learning curve for everyone! inc. me.

Screenshot from 2016-01-19 20:29:45

grep "model name" /proc/cpuinfo laptop specs.

grep MemTotal /proc/meminfo Amount of memory

head -n1 /etc/issue .  shows the linux version 8 for me.

I tried to install gnome disk, https://git.gnome.org/browse/gnome-disk-utility

Screenshot from 2016-01-19 20:48:16(I didn’t download anything, they were all .tar.xz wasn’t too sure how to install them, so I left them alone.)  but it seems that its installed already, I checked Synaptic,

Screenshot from 2016-01-19 20:49:36 Its already there, and up to date, all unbeknown to me. .  I  went to the command prompt and tried gnome disk.. and the reply command not found, also checked all the gui ‘s and nothing..

I also tried to install Unetbootin, but I’m not too sure how to update a depositary, on Debian. So i’m going to document as well as I can. I went to this website https://packages.debian.org/wheezy/amd64/unetbootin/downloadScreenshot from 2016-01-19 20:51:10.png

the site told me I should use synaptic or aptitude to download the program, I did check, and it didn’t exist in synaptic (for me) I checked using the keywords unetboot, unetbootin, an finally unetbootin_575-1_amd64.deb, As I made sure that everything was up todate  this error appeared Could not download all repository indexesScreenshot from 2016-01-19 21:23:19.png

The repository may no longer be available or could not be contacted because of network problems. If available, an older version of the failed index will be used. Otherwise, the repository will be ignored. Check your network connection and ensure the repository address is correct in ‘Repositories’ under ‘Settings’.

GPG error: http://shell.ninthgate.se squeeze InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY E639BFCB72740199Failed to fetch cdrom://[Debian GNU/Linux 8.1.0 _Jessie_ – Official amd64 DVD Binary-1 20150606-14:19]/dists/jessie/contrib/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Failed to fetch cdrom://[Debian GNU/Linux 8.1.0 _Jessie_ – Official amd64 DVD Binary-1 20150606-14:19]/dists/jessie/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Failed to fetch http://http.debian.net/debian/dists/jessie-backports/main/binary-amd64/PackagesIndex  Hash Sum mismatch
Failed to fetch http://http.debian.net/debian/dists/jessie-backports/main/binary-i386/PackagesIndex  Hash Sum mismatch
Some index files failed to download. They have been ignored, or old ones used instead.

after that I tried -> apt-get install unetbootin_575-1_amd64.deb  on the command prompt,

From the pc->

root@debian5:/home/gearoid# apt-get install unetbootin_575-1_amd64.deb
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package unetbootin_575-1_amd64.deb
E: Couldn’t find any package by regex ‘unetbootin_575-1_amd64.deb’

Going back to do some more digging..

I’m going to edit the etc/apt/sources.list using nano but first im going to follow some simple guide lines…Backup, Backup, backup.  why didn’t I check here firstScreenshot from 2016-01-19 20:59:16.png

I decided against editing my etc/apt/sources.list  I was afraid that I would delete everything.

sudo aptitude install  pool/main/g/gnome-disk-utility/

and also synaptic install pool/main/g/gnome-disk-utility/

and got this Screenshot from 2016-01-19 21:26:43

nothing happened ..

Calling it a night for now, must do more study into it..

Day 2 still nothing, not that I expected the faries to fix the problem during the night.. perhaps ill format the drive to EXT4 to see if that will solve the problem, finished, now I can’t see my hard-drive, while I’m trying to sort out this problem  I’m downloading the distribution im going to install onto my usb, http://xubuntu.org/getxubuntu/#regular this version is 14.04 trusty tahr. wu Now my usb isn’t working so.. doing some reading and its not showing up as a anything..since I also have a windows machine I also tried to sort it out on that, (by just plugging it in and formatting)..but no such luck… so doing some digging and checking on the net i found a site that showed how to find your usb stick typing in the command sudo fdisk -l got a list of my usb /dev/sdc1 and dev/sdc2 drives  Its back🙂 I would you don’t know how many smiles I wanted to add.. I checked and double checked that it wasn’t my main hard-drive..still intact.Screenshot from 2016-01-20 20:53:52.png

aside –checking the size to make sure that it wasn’t my harddrive.Screenshot from 2016-01-20 20:56:47.png

putting in the command sudo mkfs.vfat /dev/sdc2  I got my usb back …so now I’m back to square one It was a learning curve for me.

Now back to square one…trying to create a USBlive stick.  I was reading about this command called ‘dd’ but I’m stil too young and my machine has much too valuable information to mess around with this command. I’m still trying to make sure that its absolutely positively correct before using the above command.

 

I found a web page, I think from the tutors old students, I’m following this to see if it will help me. http://syn.theti.ca/2013/06/22/tutorial-wheezy-live-iso-hybrid-with-persistence-on-usb/ as I’m going through the instructions I find out that I don’t have ‘parted’ installed so I must go to synaptic and install it, by putting in my ‘Sudo’ password and putting in the Debian disk 1, since I’m installing parted I’m also going to check the other commands that I need for this process. Now all up to date. As I formatted the usb for the Xth time, I noticed that its on NONE for access for groups and for others. So how to change that, more study..I found this site

http://askubuntu.com/questions/321010/how-to-change-permissions-on-a-usb-stick

Screenshot from 2016-01-20 22:15:08.png

, I put in the commands on screen, It didn’t work I noticed it changed drive. to Sd0 as apposed to sdb.  I checked if the above commands worked, no they didn’t Still nothing or still the same, more study needed.

Ok, I’m going with dd, well at least I’m going to try it. I backed up my system, (not going to go into detail here as I just followed someone elses blog or website http://www.aboutdebian.com/tar-backup.htm and followed the instructions there. On doing this again to be positive, I get an error,

sudo tar -xvpf /fullbackup.tar  <- Me being all smart and backing up data!
[sudo] password for gearoid:
tar: /fullbackup.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
gearoid@debian5:~$ not done.

Ok, I’m going to use dd or disk dump, I think I tried everything else, this decision is not taken lightly, in fact I’m nervous. So on doing some study on this command,  thanks to http://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/ Screenshot from 2016-01-21 07:24:33

Look at the warning, atleast 5 times!! and if that wasn’t confusing and a serious “pls leave whist you can”  then the command ist that easy to understand either. so getting what little information i could from this page (but is good as a reference. I thought id find a little more user friendly site http://askubuntu.com/questions/512059/using-dd-command-to-create-bootable-usb-stick, but i changed some of the commands first I checked where my usb stick was (and double checked, and checked again to be sure. df -h works /dev/sdb1       913M  913M     0 100% /media/gearoid/Xubuntu 14.04 LTS amd64 <- thats me,  remember and write down /dev/sdb1 your usb.

now go into where you downloaded the .iso for me that was Downloads,  using the command ls to see all the directorys and then   cd  Downloads .

->.gearoid@debian5:~/Downloads$ then the dd command, this requires the sudo command, so its sudo dd if= name of image.iso of =/dev/your usb bs= 1M  (the bs is the amount of block data to be written,I left it the same) The  command is broken up into two parts the first section is the input (the directory were it is stored) and the second is the output (destination, i.e. usb)

The command line syntax of dd differs from many other Unix programs, in that it uses the syntax option=value for its command line options, rather than the more-standard –option value or —option=value formats. By default, dd reads from stdin and writes to stdout, but these can be changed by using the if (input file) and of (output file) options. http://www.wikipedia.com

so the command in its everyday state,

when I ran this command there is no process bar so it takes time, also when booting for the first time also takes time, having a usb2.0 stick doesn’t help matters.  At the end,  I know how to use dd to make a flash drive… the entire use of the command I’m still working on. This is the command that I used, notice that i shortened the ubuntu.iso file down alot to avoid errors on my behalf, and also went into the Downloads directory I’m sure that you don’t need to go into the Downloads or for that matter any directory but it makes the command that more cumbersome (for a first time user) then when you boot it for the first time (on this machine i didnt have to go to any special settings it booted straight away (after a 3 minute  black screen) but for the second and third times one has to go into the bootup settings or options.

$ sudo dd if= ubuntu.iso of=/dev/sdb bs=1M

Ran the program and since their is no progress bar, one has to wait until the cursor comes back, then reboot.

this reboot was different to the others as I didn’t have to select the usb stick it did it automatically.

then xubuntu splash screen appeared,

The END.

This is all possible by our lecturer Tero Karvinen -Thanks Tero http://terokarvinen.com/2016/agenda-for-linux-basics-dat8tf063-27-spring-2016