News:

The Latest electronic and computer Tips that work!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - branx86

#201


One (at minimum) USB external hard drive for simple network backups and file serving



Once you have gathered up the hardware, followed along with the Getting Started with Raspberry Pi tutorial to get up to speed (and are running Raspian) it's time to start setting up your Pi as a NAS.
Once you're at the command line the first thing you need to do is to add in support to Rasbian for NTFS-formatted disks. To do so type the following command: sudo apt-get install ntfs-3g 

Then do: sudo fdisk -l


The first disk /dev/mmcb1k0 is the SD card inside the Raspberry Pi that houses our installation of Raspbian. We're going to leave that one completely alone.
The second disk, /dev/sda is our first 1TB external hard drive. Make a note of the hard drive names.

Before we can mount the drives, we need to create a directory to mount the drives to. For the sake of simplicity we're going to simply make directory called USBHDD1 and USBHDD2 for each drive. First we have to make the drives. At the command line enter the following commands:  sudo mkdir /media/USBHDD1
After you've created the directory, it's time to mount the external drive to each location.
sudo mount -t auto /dev/sda1 /media/USBHDD1

Time to install Samba so we can access the storage from elsewhere on the network. At the command line enter: sudo apt-get install samba samba-common-bin

Make a backup copy of the Samba configuration file in case we need to revert to it. At the command line, type the following command line: sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old

Do some basic editing in the Samba config file. Type the following at the command line:  sudo nano /etc/samba/smb.conf
You should see something like the following in your terminal window:


The workgroup identifier, by default workgroup = WORKGROUP. If you're using a different name for your home workgroup.
Turn on user authentication for our samba storage, otherwise anyone with general access to our network (like guest Wi-Fi users) will be able to walk right in. Scroll down in the Samba config file until you get to the section that reads:


Remove the # symbol from the security = user line (by highlighting it with the cursor and pressing delete) to enable username/password verification for the Samba shares.

add an entirely new section to the configuration file. Scroll all the way down to the very bottom of the file and enter the following text:
[Backup]
comment = Backup Folder
path = /media/USBHDD1/shares
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no


Note: Whatever you put in the brackets in the top line is going to be the name of the folder as it appears on the network share. If you want another name other than "Backup" now is the time to edit it.

Press CTRL+X to exit, press Y when asked if you want to keep changes and overwrite the existing configuration file.
Then do: sudo /etc/init.d/samba restart

Add in a user that can access the Pi's samba shares.  You can make your username and password whatever you wish. To do so type the following commands:
sudo useradd backups -m -G users
sudo passwd backups



To make a legitimate Samba user. Enter the following command:  sudo smbpasswd -a backups
Now go to your windows computer and put in the Raspberry Pi address:

When prompted, enter the credentials you created in the previous steps.

Configure our Pi so that when it restarts it will automatically mount the external hard drives. To do so we need to fire up the nano editor and make a quick edit. At the command line type:  sudo nano /etc/fstab

Add a few quick entries. Within the nano editor add the following lines:   /dev/sda1 /media/USBHDD1 auto noatime 0 0

So far our Raspberry Pi NAS is hooked up to the network.
sudo apt-get install rsync

Once rsync is installed, it's time to set up a cron job to automate the process of copying files from the USBHDD1
At the command line enter the following command:  crontab -e

The command will open up your cron scheduling table in the nano text editor which should be rather familiar to you at this point in the tutorial.  Go ahead and scroll down to the bottom of the document and enter the following line:   

0 5 * * * rsync -av --delete /media/USBHDD1/shares /media/OtherHDD/shares/


This command specifies that every day at 5:00AM (the 0 5 part), every single day (* * *, wild cards in the year, month, day spots), we want rsync to compare the two directories, copying everything from HDD1 to HDD2 and deleting anything in the backup directory that no longer matches something in the primary directory—i.e. if we have a movie file on HDD1 we delete, we also want that file to be removed from the backup on the next synchronization.

If you wish to run the rsync immediately to get the data mirrored faster and make the initial cron job a little lighter on the system, go ahead and enter the same rsync command you put into the crontab at the command line like so:   rsync -av --delete /media/USBHDD1/shares /media/OtherHDD/shares/

That's it!

#202
Windows Fixes / Convert VHDX to VHD
December 03, 2015, 10:46:21 AM
 VHD - Is Limited to 2TB.
VHDX - Is to allow the image to break to 2TB limit.

VBoxManage.exe clonehd "PATH_TO_YOUR_FILE.VHDX" --format VHD "PATH_TO_CONVERTED_FILE.vhd"

VBoxManage.exe is part of Oracles VirtualBox.
#203
http://www.stevejenkins.com/blog/2010/08/renewing-a-self-signed-ssl-certificate-on-fedoracentos/


Verify the filenames, locations, and the directives of your web server's SSL configuration by doing:  grep SSLCertificate /etc/httpd/conf.d/ssl.conf

You should get something like:
# Point SSLCertificateFile at a PEM encoded certificate. If
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
# Point SSLCertificateChainFile at a file containing the
# the referenced file can be the same as SSLCertificateFile
#SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt

you can change how long you want the certificate by by changing  -days 1460      365= 1year   1460= 4 years
Type the following as root:  openssl req -new -days 365 -x509 -nodes -newkey rsa:2048 -out /etc/pki/tls/certs/localhost.crt -keyout /etc/pki/tls/private/localhost.key


Answer the questions as they are presented to create your new certificate files.

Type service httpd restart to restart your web server and tell it to use the new certificate files.

You're done!
#204
Linux Fixes / Show Repo list and enable and Disable
November 18, 2015, 12:16:01 PM
yum repolist all


yum-config-manager --enable  <RepoName>

yum-config-manager --disable  <RepoName>
#205
Linux Fixes / The Version of Linux your using
November 09, 2015, 03:49:44 PM
Do uname-a   or   cat /etc/*-release
#206
Windows Fixes / Reset Password Win 7 & 8
November 04, 2015, 03:08:13 PM
Boot into Recovery mode:  F11 while booting or Boot CD/USB

The following screens appear one after another, after following your vendor's method of entering into recovery mode.


Choose your keyboard layout.





Choose !!!!!****Troubleshooting!!!!***** option




Choose Advance option..



Choose Command Prompt option.

rename utilman.exe utilman2.exe
rename cmd.exe utilman.exe


Now restart your computer, at the logon screen, click on bottom left icon and command prompt will open. Now use the net user trick



Open CMD (command prompt) with administrative rights to type this command.

net user <user-name> <Password>

Reboot, after getting into Windows 8, please remember to rename the Utilman.exe.bak back to Utilman.exe.

That's it – you have successfully reset your forgotten Windows 8 password.

#207
General Discussion / Laser Transmiter & Receiver
October 22, 2015, 01:57:08 PM
Laser transmitter

Cheap laser pointer
Batteries
Transformer radio shack 273-1380
Solar cell radio shack 274-124 or a photo resistor
Wire



connect the 1,000 ohm side of the transformer between the battery and the laser. The 1,000 ohm side of the transformer has three wires coming from it. We only use the outside two wires. The inside wire is called a center tap and we do not use it in this circuit. Test the laser by attaching the battery. The laser should operate normally at this point.



The receiver is the simplest part. You simply connect the solar cell to the microphone jack, and plug it into the amplifier or stereo phono input. It does not matter which way the wires are connected to the solar cell. Here is the schematic of the receiver:




All Together and working.


#208
General Discussion / Dell Monitor E228WFPc Repair
October 22, 2015, 01:29:35 PM
Does your monitor come on then turn off?  The fix is R821 and C808.
Dell monitor
E228WFPc
R821= 1mega ohm 1/2watt.   Qty2
C808= 2.2uf@16v
#209
Linux Fixes / Reset a Forgotten Root Password
October 22, 2015, 01:19:10 PM
Tips & Tutorials - for Linux users & RHEL/CentOS SysAdmins
April 20, 2014
How to Reset a Forgotten Root Password
In case you forgot the root password on a Linux system, you can reset the unknown current password and change it to a new one, by booting the system into "Single User" mode.

In Single User mode (which is equivalent to "Runlevel 1") - the regular boot process is interrupted, and you quickly reach a root prompt from which changes can be made.

Booting into "Single User" mode ("Runlevel 1")

1. When the system's boot process begins (after power-on/restart) -
Press any key to interrupt the GRUB bootloader countdown.

2. If a password was configured to protect access to GRUB - press "p" to enter the password.
If no password was configured - skip this step.

3. Press "e" to edit.

4. Use the Arrow Keys to move to the kernel line.

5. Press "e" to edit the kernel line.

6. At the end of the line (which might read, for example: "rhgb quiet"), add: "<space> single".

(Btw, "<space> 1" will work as well).

7. Press "b" to save & boot with changes.

8. After a root prompt is obtained: enter the passwd command, and change the root password to a new desired one.

9. Type exit to continue the boot, and wait for the system to load as usual.
#210
General Discussion / Convert Media Using VLC
October 20, 2015, 09:38:49 AM
Step 1: Launch VLC media player and click on Media –> Convert / Save.


Step 2: Under the file tab you will see two sections. In the first one add the file you want to convert while the second section can be used to embed a subtitle to the converted video that's already in sync.


Step 3: Click on the Convert/Save button when you are done. Finally select the destination folder, give a desired filename, select the desired video profile and click on the start button.



Note: By default VLC media player comes packed with a few profiles that can convert your video to most of the widely used audio and video formats. You can edit, delete or create new profiles using three buttons located next to the select profile dropdown list.


You can play with various settings like audio and video codecs to get your desired conversion profile.

Step 5: Once everything is at place press the start button.
#211
General Discussion / Record a stream to file using VLC
October 20, 2015, 09:23:26 AM

You need the stream Location URL!!!!
Right-click on the video and from the Properties dialog copy the URL you can find at "Location".



    open VLC and go to Media → Open Network Stream... The Open Media dialog will open, paste the URL you've just copied in the URL box.


    Unfold the "Play" button and click on the Convert option. You can also do this by pressing Alt+C in your keyboard.


    In the Convert dialog you will have to select the location and type of the destination file. Click the Browse button and in the explorer like window you can browse your folders and give a name and extension to the output file.




    Click OK and you are back to the Convert dialog, here you will be able to select if you want to view the output while recording and the profile. For this example I selected the default Video – H.264 + AAC (MP4) but you can choose the one that best fits your needs.


    Click start and after a few seconds of buffering the live feed video will start being recorded.



    To end the recording just click the Stop button and to play the output file all you have to do is go to the containing folder and double click on it. Depending on the file type you selected and your system configuration it will be played on different players.
    Final Words

    Now you can start recording all those live feeds you've always wanted to save for later viewing or to share with your friends and family. VLC media player makes it easy and simple for you.
       

      
















#212
General Discussion / Record Desktop VLC
October 20, 2015, 09:04:40 AM
 1.   Under Media, click "Open Capture Device."
2.   Click the "Capture Mode" dropdown and select "Desktop."
3.   Modify the frame rate. 15 f/s will probably be good enough for desktop recording, though 30 may be required for more fast-paced movement.
4.   Click the dropdown arrow next to "Play" and select "Convert."
5.   In the "Profile" dropdown, choose MP4.
     1.   At this step, you can click the tool icon to modify the settings of this profile. Here you can modify things like resolution or bitrate. We'll use the default settings for now, but you can come back here later if you need to tweak the final product.
6.   In the Destination box, choose a location to place the finished file.
7.   Click Start.

Once you click Start, VLC will stream a feed of your desktop into itself behind the scenes. Let it run while you record your workspace. When you're done, you can click the stop buton in the player controls to end recording.
#213
General Discussion / Start IOS app over ssh
October 14, 2015, 02:53:10 PM
Install the command-line utilty open from Cydia and just execute

open com.apple.calculator    for the calculator

Came from http://stackoverflow.com/questions/8759042/launch-gui-app-on-ios-5-through-the-command-line-jailbreak/11383664#11383664

Open program  https://github.com/conradev/Open
#214
 Make your own soda or fizzy drink.

  Great Guide   https://snapguide.com/guides/make-a-pseudo-soda-stream          or     http://snp.gd/hax4re



Parts list -     CarbaCap (Carbonater Cap)




Ball Lock Gas Barb 1/4 

1/4"Clear Flexible PVC Tubing Heavy Duty UV Chemical Resistant Vinyl Hose Water Oil 10' is plenty 

Dual Gauge Co2 Regulator for Draft Beer / Homebrew / Kegerator

1/4"x1/4"Brass Hose Barb x Male Pipe Thread NPT, MIP 

1/4 In Full Port Ball Valve (HarborFrieght)Central Pneumatic - item#68254

1/2 in. x 43-1/2 ft. Plumber's Thread Seal Tape

Co2 Tank to have refilled or swap at Airgas

2 Liter empty Bottles

Put all parts together should look similar




Adjust the pressure of the C02 Output to 45-50PSI

Fill 2 liter with cold water screw on Connect Ball Lock Gas Barb and shake for 30sec. Remove Ball Lock Gas Barb connector.    Now enjoy your Carbonated water ;D
www.youtube.com/watch?v=BLFvw4CVKgY
#215
The folder  in windows  C:\Users\(Logged User)\Documents\Arduino
You need the libraries to make the sketches work.
Must use Arduino 1.0.5 or 1.05r2 for sketch to work
Ethernet Shield Wiz5100
Download LedBlink and follow the instructions in the zip.


#216
Solar Power / Diode Direction for Solar Panel
October 08, 2015, 11:30:51 AM

#217
Solar Power / Battery Voltage charge state chart
October 08, 2015, 11:21:25 AM



#218
Raspberry Pi / Raspberry Pi GPIO pins
October 08, 2015, 11:18:33 AM


#219
Installing Postfix is easy, just run this command as root:

yum install postfix mailx cyrus-sasl-plain

Configuring

Create a file named sasl_passwd in /etc/postfix. Replace smtp_user and smtp_passwd with their respective values.
           echo "smtp.gmail.com    user@gmail.com:Gmail_password" > /etc/postfix/sasl_passwd

You then hash that file so that the password is not stored in clear text. This command will create a file named sasl_passwd.db in the /etc/postfix/ directory.
      postmap hash:/etc/postfix/sasl_passwd

After that is done, add these to the bottom of /etc/postfix/main.cf. This is assuming that your root certificates installed from openssl are located in /etc/pki/tls/certs/ca-bundle.crt.

      smtp_sasl_auth_enable = yes
       smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
       smtp_sasl_security_options = noanonymous
       # Secure channel TLS with exact nexthop name match.
       smtp_tls_security_level = secure
       smtp_tls_mandatory_protocols = TLSv1
       smtp_tls_mandatory_ciphers = high
       smtp_tls_secure_cert_match = nexthop
       smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
       relayhost = smtp.gmail.com:587


After that is done, restart postfix:

    service postfix restart

Now test it to make sure it is working. Run this in the terminal:
    mail email@domain

Fill in the subject, put something in the body and then type a . on a blank line to end and hit enter.

If all went well, you should get an email at the email address you entered. If you do, you can delete the file that has the password.

rm /etc/postfix/sasl_passwd

If it did not work, check the log to see what happened.

tail /var/log/maillog
#220
General Discussion / Light Fixture Base Types
October 08, 2015, 08:35:54 AM