What is HasGeek

Category: Operating Systems

Soft core OS

After a soft core processor has been loaded into an FPGA, the OS is set up. At Altera this is Nios2, at Xilinx it is MicroBlaze.

Remote access to OS
The softcore is accessed via SSH (or Nios Shell).

Folders and programs
If you build in a soft processor, it creates a software subfolder in the synthesis folder

Necessary scripts and settings can be stored in this folder.

Generate board support packet
The script create forms the support packages (and folders for them)

Compile

Run the program on the FPGA

Posted in Categories Operating Systems, Embedded Systems, FPGA

Protected: upgrade program before installation

Posted in Categories Operating Systems, LinuxTags Microprocessor

debian on raspberry pi 2

Load Debian onto SD card

Steps of Juan:

  1. Download and extract the jessie-rpi2 - *. Img.gz to get an .img file
  2. On any debian-based linux type sudo apt-getinstall bmap-tools and install it.
  3. Then type sudo bmaptool copy - nobmap jessie-rpi2.img / dev / sdx (Change yourlocation to the location of the .img file and sdx for the letter where the SD is mounted, if you don't know it type sudo fdisk- l and look for it).
  4. Wait until it finishes and then put the SD on your rp2.

First SSH login for configuration

  • Connect the RPi to the router via Ethernet and then connect it to the power to boot.
  • Check on the router which IP address the RPi got (by name of the machine)
  • $ ssh [email protected] with password debian

Configure the basic system

  • Create accounts for ale and katrin. Login without password, only with key.
    • adduser katrin (+ ale)
    • on Linux, generate SSH-key: ssh-keygen (asks for a path)
    • scp [email protected]: .ssh / (+ ale)
    • on the rpi: catid_rsa.pub >>. ssh / authorized_keys
    • Set access rights for ~ .ssh / * to r--
  • no login for root and only key login for the user:
    • edit / etc / ssh / ssh_config,
    • Set PasswordAuthentication no and PermitRootLogin no.
  • Set up port forwarding for https on the router

Install owncloud

  • add the external hard drive to / etc / fstab
    • read out the uuid of the hard drive with blkid
    • add the following line in / etc / fstab:
      UUID = 375cae2c-e89e-45ef-80f3-ee65e54b27e2 / mnt / data ext4 defaults02
    • ln-s / mnt / data / owncloud / var / www / owncloud / data (if data / already exists, first rename and then copy the content to the new data / directory; it does not seem to be possible to access other drives)
  • add user owncloud in the database:
    $ mysql - user = root - password mysql
    create user'owncloud '@' localhost'identified by'owncloud'WITH GRANT OPTION; GRANTALLPRIVILEGESON *. * TO'owncloud '@' localhost ';
    SELECT User FROM mysql.user;
    create database owncloud;
  • Add Community Debian repository from Owncloud and install the latest Owncloud
  • Install php5-mysql for this
  • Question: should we need nginx instead of apache? (http://etapien.com/guides/how-to-install-owncloud-on-debian-7-with-nginx/)
  • Call up, create an admin account and be sure to click on |> to select mysql as the database.
  • Set port to non-standard for SSH (22; https://www.adayinthelifeof.nl/2012/03/12/why-putting-ssh-on-another-port-than-22-is-bad-idea/)
  • Securing MySQL: MySQL ships with a few conveniences that are supposed to be removed when put on a real server, to do that type:
    sudo mysql_secure_installation

DNS

  • You need to log into your Domain Registra’s account and set the A-record for your domain (mysite.com) to point to your router’s public IP address.

SSL

  • https://blog.hasgeek.com/2013/https-everywhere-at-hasgeek/
  • https://hallard.me/enable-ssl-for-apache-server-in-5-minutes/
  • http://www.startssl.com/?app=1

VPN

  • You’ll need to forward port 1194 (UDP traffic) to your Raspberry Pi’s internal IP address.
  • Install openvpn
    • http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing
    • http://www.raspberrypihelp.net/tutorials/1-openvpn-server-tutorial
    • http://www.linuxuser.co.uk/news/create-a-vpn-with-the-raspberry-pi

Set up WIFI as a LAN connection to Raspery Pi

  • Install wicd-curses (network manager)
  • add the netdev group for both users
  • the wifi should be recognized automatically, if not:
    • sudo iwlist eth2 scan shows all access points
    • In the preferences of wicd set wlan0 as device and restart wicd

How to get the wifi to work: http://sjoerd.luon.net/posts/2015/02/debian-jessie-on-rpi2/#comment-2210d3fbce30bfee22ad73d751a14d31$

Other programs

  • usbutils for lsusb
  • vim
  • sudo update-alternatives - config editor
  • sudo nmap-sP192.168.1.0 / 24 to discover the ip addresses around you
Posted in Categories Operating Systems, Linux, NetworkTags Instructions, Microprocessor, Raspberry

File storage Linux

root / bin programs for OS, console e.g. bash, cat, rm
root / home / files from users
root /opt Programs self installed Ex: Nios, Questsim, altera
root /Etc/             Configuration files
root / sbin programs for communication Example: dhcpclient, wpa_cli
root / sys system utilities
root / usr programs installed via install Example: ADB, cpp, blabla

Posted in categories operating systems, LinuxTags data storage

Set system path and environment variable

Programs are started from their folder.
If you want to be able to run programs from anywhere,
the path of the path variable must be passed.

Add the path to the path variable

PATH = $ PATH: / home / katrin / bin

- The path is always given from root
- Paths are separated from each other by:
- The old PATH variable ($ PATH) got to to be named.
The new path is appended after the colon

Set path in .bashrc

export PATH = $ PATH: /opt/altera/13.0sp1/quartus/bin

.bashrc is in the home as a hidden file

Set variable (in Windows) as system variable

System and security / System / Advanced system settings
In this popup there is a button: Environment variables

Click and give the variable a name: LM_LICENSE: blabla_5
Give the variable a value: [email protected]: 563

Posted in Categories Operating Systems, LinuxTags Paths, Assigning Rights, Variables

Script Linux

Drop location


Execute (at storage location)

In the directory itself, the script is executed with ./.


Assign the script to the PATH variable

PATH = $ PATH: / home / katrin / bin

If the path variable is set, the script can be called from anywhere.


Run script anywhere


content

# add program to global path

Here, not the script path, but the program to be executed is assigned to the path.

Define the script as executable

Send parameters via console

echo $ 1 "number_measurements"
echo $ 2 "number_repetitions"
# packetlength is a local variable
forpacketlength in10040014001500 \
do
# Output console current packet length
echo $ l
foriin`seq1 $ 2`
do
iperf3-c10.4.30.50-l $ packetlength
done
done

- echo outputs string to console
- $ .. are variables
- echo $ .. requests input via console with whitespace (enter or space)

script.sh 5 2

If you forget the parameters, the program asks for them when it starts
// ]]>

Posted in categories operating systems, data management, LinuxTags data storage, paths, search

Aliases in Linux

- Alias ​​replace commands with a keyword
- Calling up the keyword starts the command. Aliases must be entered in home / .bashrc
- Aliases cannot only contain the arguments (without a program)

syntax

// keyword = endocsope, command = ssh
aliasendoscope = "ssh [email protected]"

Set alias

gedithome / katrin / .bashrc