Hot answers tagged

9

[If all you want to do is shrink the partition on the card, there is a simpler way to do this than explained here by first using resize2fs on the filesystem, then using fdisk to shrink the partition; there should be many examples of this around online, e.g., at Unix & Linux. The method below involves creating a new, smaller card image. Either way, you ...


8

here's a short version of bash script for your purpose: #!/bin/sh df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do echo $output usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) partition=$(echo $output | awk '{ print $2 }' ) if [ $usep -ge 90 ]; then echo "Running out of space \"$partition (...


5

Already answered here dd-on-entire-disk-but-do-not-want-empty-portion Assuming you want to save /dev/sdXN to /tgtfs/image.raw and you are root: mkdir /srcfs && mount /dev/sdXN /srcfs Use zerofill or just: dd if=/dev/zero of=/srcfs/tmpzero.txt To fill unused blocks with zero (wait for it to fill the file system completely then rm /srcfs/tmpzero....


5

Please before you start commenting about breaking the law etc etc notice that there are many freeware programs out there which you can download and share freely. Also, I would have posted more links for the software you need to do this, but I do not have enough reputation First of all these are the things you need to start your project Your Raspberry Pi A ...


5

I spent a number of hours recently with my C920 and a Raspberry Pi 3 recently to make a babyCam that I could stream within my home network. I may be able to shed some light but also provide documentation and experience to other users. OK, to use the Video4Linux2 driver to find the camera's video device do this: v4l2-ctl --list-devices My experience: I ...


4

Could it be something as simple as the camera being recognized as something other than /dev/video0? Does ls /dev/video* yield anything else? It's been many months since I used a C920 on my Raspberry Pi, but at the time, everything "just worked" so long as I used the right device.


4

I basically didn't have a Keyboard I could use for my Raspberry Pi and was wanting to do the same. I did this: Insert the SD card into the MacBook Open Applications > Disk Utility > right click on the partition under "Apple SDXC Reader Media" > unmount Take a note of the "Device" name on "Apple SDXC Reader Media" mine was disk3 Install Virtual Box Run this ...


4

https://www.raspberrypi.org/documentation/linux/filesystem/backup.md explains backup and restoration. You don't indicate what OS you are using but it is simple on any 'NIX system. I use the following on macOS #!/bin/bash # script to backup Pi SD card # 2017-06-05 # 2018-11-29 optional name # DSK='disk4' # manual set disk OUTDIR=~/temp/Pi # Find disk ...


4

I assume you're running Rasobian Stretch. No idea what you are talking about re directory / file. Standard lxde autostart file is '~/.config/lxsession/LXDE-pi/autostart' But RealVNC server is normally started from a systemd service file. The easiest way to activate it is from the Configuration Utility (Start Menu / Preferences) or sudo raspi-config from ...


3

Far from a Pi specific question but: First, -s is not a hard link. It's a symbolic, aka. soft one. Is there an advantage or penalty? Neither. However, doing this in /usr/lib (either copying or linking) is not a good practice. That's where distro stuff goes, and at some point something may get overwritten one way or another. User installed libs should ...


3

openssl output is incompatible with almost everything else and impossible to use to check anything except maybe a single file. the standard way to generate MD5 checksum is to use: $ md5sum file1 file2 file3 sommorefilez* >files.md5 the result is saved to the file using the output redirect with > sign and you may check the checksums later using: $ ...


3

Assuming you're using Raspbian... Use . And on right click: if you press shift after them menu opensthe option move to wastebasket changes to Remove


2

You can use ssmtp and mailutils to send out emails. Just google and you will find some tutorials. You can use ssmtp and mailutils in python by using os.system() orsubprocess(). To check for file size, again, do a little googling. Here is one from here. Here is a snippet: import os # Return CPU temperature as a character string ...


2

The files would be in an ext4 partition. There are third party solutions which can read these on Windows or OS X. They can be read on any Linux system, including a live CD.


2

Due to the way the SD-card reader is connected in Macbooks, you can't mount the root Filesystem on Partition 2 of the card which is formatted in EXT (no virtual machine or other Programm will be able to access the SD-reader in OSX). The first partition is FAT32, which is automatically mounted by OSX and shows up in Finder. You can only boot native to Ubuntu ...


2

I found that this command will give you the IP address only: $ /sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' To output it to a file: $ /sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' > "/var/www/ipadress.txt"


2

If you just want to read the files, you can install nginx on your Pi and share the directory that has the files you want everybody else to read. This is read only, is pretty simple and very light weight. You then get your files by using anything really. Another way is to create NFS shares, these should work well between Pi's if you are on the same network....


2

On step 2 of the same tutorial: export EASY_RSA=”/etc/openvpn/easy-rsa” Make sure you didn't copy-pasted with the ”” but with "" like: export EASY_RSA="/etc/openvpn/easy-rsa"


2

You are correct about ifnotify - and kudos to you for discovering it. It cannot react to the absence of an event. What you are going to want is a script or a python program to do as you described. Either can monitor a directory to see if it has had a file added. It is not clear to me whether your stream of files means that every XX seconds a NEW file ...


1

I think 1 second update it's to much for that application, I've found that sometimes, bluetooth data get "lost" if the messages are send to fast. Maybe 10-15 seconds update will be alright. I'll go with a MCU and getting the data in there, storing it until it's send to the app. You can send a message from the app to the MCU to trigger the data send. One ...


1

A solution is to connect pins 6 (ground) and 8 (gpio 14 UART TX) via a 3V3 compatible USB serial dongle to another computer, By default The boot messages are sent to the UART. The data is transmitted at 115200 bps, 8 data bits, no parity, 1 stop bit (115.2 8N1). If you launch minicom or equivalent software on your computer you will then be able to view/...


1

Shrink your second partition with gparted to eliminate free space and use dd to only backup the parts you need. I suggest using a gparted Live CD (based on Linux) to modify RPi partitions. You can boot from such a disk without touching your Windows install at all. This is much safer. You can now use dd to only backup the parts of the SD card that matter. ...


1

I presume you are asking how to copy files in PCManFM which is the default File Manager in the latest Raspbian GUI. (PIXEL is the name of the Desktop Manager “Pi Improved Xwindows Environment, Lightweight”.) You can copy files with the Edit/Copy and Edit/Paste Menu items, more conveniently using Ctrl+C and Ctrl+V shortcut keys, which are the same as Windows....


1

Keep all your executable files in a folder, I usually keep it in /home/pi/. Your folder can be called for example exec mkdir exec move your Python3 script into this folder: mv myScript.py ~/exec/ In your myScript.py add the shebang line on the top-most part of script $ nano myScript.py ## add this line on top of file !/usr/bin/python3 CTRL+O then ...


1

I figured out what my problem was. I was using the wrong 'muxer'. When I switched to using the 'ogg' muxer, I was able to write to a file just fine. For the record, the command that is working for me is as follows: cvlc –no-audio \ v4l2:///dev/video0 \ –v4l2-width 1920 \ –v4l2-height 1440 \ –v4l2-chroma MJPG \ --run-time=10 \ –sout=file/ogg:/tmp/filename....


1

Your understanding of the problem seems to underestimate the write life of the given flash memory. "everything is a file" philosophy. This is true, but only kind of. The "everything is a file" philosophy doesn't mean it's a legitimate (as in physical) file. /proc/cpuinfo, for example, is a "file", but it doesn't reside anywhere on the disk. It's a ...


1

If you have a file '/home/pi/Desktop/hello.txt' on 'raspberry1' and you wish to transfer it to 'raspberry2': On 'raspberry1' : bring up a terminal. Change into the directory where you file 'hello.txt' resides: Startup an 'sftp' session to 'raspberry2'. Within the 'sftp' session, change into the directory where you want to copy the file. Issue a 'put' ...


1

I figured out that it works if you remove the ".jpg" at the end of the file name.


1

The answer by @joan is correct, but you have not locked up the Pi, merely put the terminal display into a different mode (or possibly paused output with XOFF which can be resumed with XON i.e. CTRL+Q). If you have a reason to look at a binary file you can use cat -v which displays non printable characters so they are visible. There are many editors which do ...


1

To fix the problem enter the command reset Don't worry if funny characters are echoed back as you enter the letters. Linux terminals actually emulate old fashioned VT type terminals. Certain control characters and sequences are used to change cursor position, screen colour, and such things as display language. By writing binary to the screen you are ...


Only top voted, non community-wiki answers of a minimum length are eligible