Wednesday, January 31, 2018



https://haydenjames.io/increase-performance-lifespan-ssds-sd-cards/

Covers I/O performance.  iotop used to show disk read / writes

Using iotop to monitor and minimize reads/writes

Use can your Linux distro’s package manager to install iotop which is a top like utility for disk I/O. It monitors disk I/O usage information output by the Linux kernel (2.6.20+) and displays a table of current usage by processes on the system. Use iotop with the following options:
iotop -oPa
Then let iotop monitor things for a few mins or hours depending on how intense disk I/O is. This will result in a top-like screen which makes it easy to identify processes that are hogging your disk I/O.  Have a look at the screenshot below as an example. I used the iotop -oPa command and let it sit for a few minutes in the background:

30

raspberry pi raspbian wifi setup


Here is a thread about setting the wifi up manually.

https://www.raspberrypi.org/forums/viewtopic.php?t=184651

30

Sunday, January 28, 2018

Configuration information tools for linux


Show basic linux kernel and system information.
uname -a

lsb_release -a

basic informational command (usually needs to be installed).

inxi -Fc0

shows basic system info, including if available the box information.

sudo lshw -C cpu
sudo lshw -C memory
sudo lshw -C network
  

30

Friday, January 26, 2018

(no) root squash on open media vault.


to combat user access abuse with nfs protocols, there is a method called "squash" which takes care of making sure that accesses with can be mapped properly to correct ownership on the server end.

The NFS protocol embeds the path in the protocol in such a way that there can be mismatches from client to server.  Unix user id and group id numbers are used, and unless they are coordinated from end to end, a user accessed whatever user on the server that has is user number.

Also the special user, root, zero is especially dangerous, since access root owned files on the server might allow the client to modify privileged files.

The squash allows the server to do one of two actions.  To prevent write access to files on the server, the root_squash means that any root files written will be 'squashed' to the ownership and group of the configured 'nobody' user on the server.  One can have a root user on a client, create a file on a directory on the server, and that file will end up owned by the 'nobody' user preventing access to root privilege via that means.

"all_squash" allows all ids accessing the server for write to be forced to the guest nobody user.

The no_root_squash option disables the squash, and gives access in any way the client requests w/o any squashing.

https://linux.die.net/man/5/exports

The excerpt below has other options, but is clipped from the reference above.

root_squash
Map requests from uid/gid 0 to the anonymous uid/gid. Note that this does not apply to any other uids or gids that might be equally sensitive, such as user bin or group staff.
no_root_squash
Turn off root squashing. This option is mainly useful for diskless clients.
all_squash
Map all uids and gids to the anonymous user. Useful for NFS-exported public FTP directories, news spool directories, etc. The opposite option is no_all_squash, which is the default setting.
anonuid and anongid
These options explicitly set the uid and gid of the anonymous account. This option is primarily useful for PC/NFS clients, where you might want all requests appear to be from one user. As an example, consider the export entry for /home/joe in the example section below, which maps all requests to uid 150 (which is supposedly that of user joe).

Example

# sample /etc/exports file
/               master(rw) trusty(rw,no_root_squash)
/projects       proj*.local.domain(rw)
/usr            *.local.domain(ro) @trusted(rw)
/home/joe       pc001(rw,all_squash,anonuid=150,anongid=100)
/pub            *(ro,insecure,all_squash)
/srv/www        -sync,rw server @trusted @external(ro)
/foo            2001:db8:9:e54::/64(rw) 192.0.2.0/24(rw)
/build          buildhost[0-9].local.domain(rw)

30

Monday, January 22, 2018

install xwindows and xfce4 on Windows 10 + Ubuntu (creators version)


However, you can install graphical Linux applications and run these under WSL if you have an X server like VcXsrv or Xming, on your Windows machine. 

https://solarianprogrammer.com/2017/04/16/windows-susbsystem-for-linux-xfce-4/


a bit from the above link

1 sudo apt install xfce4
Next, you will need to modify the .bashrc file. There are a few text editors that work under WSL. I suggest to use vim or nano, e.g.:
1 cd ~
2 nano .bashrc
The second command from above will open .bashrc in nano and you can scroll to the end of the file and write:
1 export DISPLAY=:0.0
Save the modified file by pressing CTRL+X and answering Y when asked if you want to save the file. Close and restart the console window.
Next, you will need to install an X server for Windows. I suggest VcXsrv which works well with WSL. Download and start the installer, you can safely accept the default settings.

https://sourceforge.net/projects/vcxsrv/

https://sourceforge.net/projects/xming/

Monday, January 15, 2018

how to mount drives on Windows 10 Ubuntu shell


From link below, can get to drives or other servers

https://superuser.com/questions/1114341/windows-10-ubuntu-bash-shell-how-do-i-mount-other-windows-drives

Good news, it is now possible to mount USB media (including formatted as FAT) and network shares with drvfs on Windows 10:
Mount removable media: (e.g. D:)
$ sudo mkdir /mnt/d
$ sudo mount -t drvfs D: /mnt/d
To safely unmount
$ sudo umount /mnt/d
You can also mount network shares without smbfs:
$ sudo mount -t drvfs '\\server\share' /mnt/share

wicd-curses curses wifi manager


A few locations discuss headless setup of the raspberry pi for bringing up such as the rpi zero W which can be made to boot up completely disconnected, due to the presence of wifi on the board.

However it would be nice to be able to add an additional Wifi net to connect to for such as when one wants to run the board on additional networks.

My use case is to have a pocket board which runs Linux and can tether if needed to a cell phone wifi for network access.

https://raspberrypi.stackexchange.com/questions/11631/how-to-setup-multiple-wifi-networks

sudo apt-get install wicd-curses

will install a curses utility to manipulate the wifi connections.

Shell in a box on the raspberry pi

Raspian's Debian distribution repositories contain the shell in a box distribution.

sudo apt-get -y install shellinabox

will install the package.

access it via

https://<ip or name>:4200/

unless the port is configured to other port.  Since this is intended for remote management, the access to the demon is via encrypted https connection.  There are topics about  configuring this for non encrypted access, but one might as well do telnet if that is turned off.

Tagged with ssh as it is a similar access method if configured with encrypted shell access.

Here is a discussion:

http://sysmatt.blogspot.com/2014/11/manage-your-raspberry-pi-with-shell.html

good page on configuring shell in a box:  Local only, different port, etc.

https://www.tecmint.com/shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers/

Thursday, January 4, 2018

raspberry pi display 7" official info



https://forums.pimoroni.com/t/official-7-raspberry-pi-touch-screen-faq/959

Note: An update has been pushed to Raspbian to flip the screen ( rotate it by 180 degrees ) for a better desktop viewing angle. This makes it upside-down in our stand and the official Pi stand, so you’ll need to change a setting to flip it back.
To do this, open /boot/config.txt in your favourite editor and add the line:
lcd_rotate=2
This will rotate both the LCD and the touch coordinates back to the right rotation for our display stand.
Don’t use the documented display_rotate, it performs a performance expensive rotation of the screen and does not rotate the touch input.