Sharing PC WiFi internet to USB Ethernet device (raspberry Zero USB connected)

I connected my Pi Zero to my PC ( Linux LMDE 3 Cindy) via USB port successfully, SO i want to connect to internet via my laptop which is connected to internet by its WIFI.

I found this instruction or this question via raspberrypi.stackexchange but those are working for window or MAC OS,but i don’t find it for Linux!!!!

SO i need the similar instruction for enabling sharing my internet via USB enp0s20f0u1 device (PI Zero) in Linux. for example in windows we need to :

In the WiFi Properties window, click on the “Sharing” tab : similar to this photo:

i could assist one IP (192.168.7.2) for my raspberry by running this code in my raspberry based this instructions :

sudo nano /etc/network/interfaces allow-hotplug wlan1 iface wlan1 inet manual    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf  allow-hotplug usb0 iface usb0 inet static         address 192.168.7.2         netmask 255.255.255.0         network 192.168.7.0         broadcast 192.168.7.255         gateway 192.168.7.1 

I have this (sudo ifconfig) in my Linux:

 enp0s20f0u2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 169.254.27.126  netmask 255.255.0.0  broadcast 169.254.255.255         inet6 fe80::cff5:f703:7327:dd9  prefixlen 64  scopeid 0x20<link>         ether 6e:2f:15:92:bd:a8  txqueuelen 1000  (Ethernet)         RX packets 2936  bytes 244294 (238.5 KiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 2113  bytes 174942 (170.8 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0    wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.1.105  netmask 255.255.255.0  broadcast 192.168.1.255         inet6 fe80::373d:1b7f:5b9e:8ddc  prefixlen 64  scopeid 0x20<link>         ether c8:3d:d4:3c:23:63  txqueuelen 1000  (Ethernet)         RX packets 33305  bytes 31322783 (29.8 MiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 26405  bytes 4264995 (4.0 MiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 

the enp0s20f0u2i2 is my Raspberry zero which is using IPV4 Link-local only method but i could change its IP to static IP like 192.168.7.2 as described above.

And in my raspberry:

pi@raspberrypi:~ $   ifconfig -a lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10<host>         loop  txqueuelen 1000  (Local Loopback)         RX packets 72  bytes 6840 (6.6 KiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 72  bytes 6840 (6.6 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 169.254.183.232  netmask 255.255.0.0  broadcast 169.254.255.255         inet6 fe80::d7db:e53b:407d:8d65  prefixlen 64  scopeid 0x20<link>         ether ee:70:24:ba:2d:57  txqueuelen 1000  (Ethernet)         RX packets 182  bytes 28198 (27.5 KiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 172  bytes 15872 (15.5 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 

so when i do this site instruction I run this code in my Linux:

# Bring both interfaces into promiscuous mode sudo ip link set wlp2s0 promisc on 

and this code in my raspberry:

sudo ip link set usb0 promisc on 

when i run this code in my LINUX OS (laptop):

# Creating a new bridge interface sudo brctl addbr br0  # Set the forwarding delay to 0. # While this is not necessary, I learned that it help with faster configuration sudo brctl setfd br0 0 

SO when running next step (sudo brctl addif br0 wlp2s0 enp0s20f0u2) i get this error:

can't add wlp2s0 to bridge br0: Operation not supported 

so i doing this :sudo iw dev wlp2s0 set 4addr on from here to solve this bug, but i lose my internet connection :

so@notebook:~$   ping www.google.com ping: www.google.com: Name or service not known 

ans also lose my connection with my Raspberry zero (USB Ethernet).

SO what i must t to do to make a bridge for sharing my laptop internet with raspberry zero?

  • I have this kind of question in raspberrypi.stackexchange site and based on those comments,I asked this question here

Thanks a lot.

after cv.normalize(img,img), the value of img’s pixels alway is zero

from PIL import Image import numpy as np import time import cv2 as cv

im = Image.open(“./dataset//1.jpg”)

new_img2 = im.resize((64, 64), Image.BILINEAR)

mat = np.asarray(new_img2.convert(‘RGB’)) # 原始图片 mat = mat.reshape(1, 64, 64, 3)

cv.normalize(mat, mat, 1, 0, cv.NORM_MINMAX)

print(mat)

the sorce image’s pixels is not 0, but the print’s result is like below:

[0 0 0] [0 0 0] [0 0 0]]

[[0 0 0] [0 0 0] [0 0 0] … [0 0 0] [0 0 0]

Etale algebra whose local rank is constantly zero is the zero algebra

While working through a proof of this paper, at the middle of page 46, the author seems to claim the following is true:

Let $ A\rightarrow B$ be an etale map of rings. Suppose that for every prime $ P\subset A$ we have $ $ \kappa(P)\otimes_{A}B=0 $ $ where $ \kappa(P)$ is the residue field at the prime ideal $ P$ . Then $ B=0$ .

The only thing I seem to be able to extract from here is that $ PB=B$ for all primes $ P$ of $ A$ , which does not seem enough for any kind of conclusion, since $ B$ is not necessarily a finite $ A$ -module. Of course if we would have some Noetherianity or some projectivity assumptions , perhaps one can then use the connections between the different definitions of rank of a module. But else I don’t know how to use that $ A\rightarrow B$ is an etale ring map.

What is a campaign zero?

My friends have been talking about a type of D&D5e gameplay called a campaign zero. I don’t understand what it is. They are trying to get me to make my campaign into that type of game but I don’t even understand hpw to do that.

What happens when you roll zero or negative damage?

If a Kobold Dragon Mage (Pathfinder Playtest Bestiary, p. 83) hits a character with its staff, it does 1d4–2 damage. If a 2 is rolled on the die, how much damage is dealt? What if a 1 is rolled on the die?

In both these cases in 1st-edition Pathfinder, the result would be 1 nonlethal damage, but I could find no answer to this question in the Pathfinder Playtest Rulebook.

Stable maps with irreducible domain are dense in moduli space of stable maps of genus zero

there is a famous lemma which says: if $ Y$ and $ W$ are flat,projective schemes over $ S$ and $ s \in S$ be a geometric point and $ Y_s$ and $ W_s$ be fibers over $ s$ and $ f:Y_s \to W_s$ be a morphism then with some good conditions we have:

Dimension of every component of scheme $ Hom_S(Y,W)$ at a point $ f$ is at least:dim$ H^0(Y_s,f^*T_{W_s})-$ dim$ H^1(Y_s,f^*T_{W_s})+$ dim$ S$ .

Now suppose that $ C$ is a nodal curve of genus zero and $ \mu:C \to X$ is a stable map.Suppose that $ \bar{C}$ be smoothing of $ C$ over some base like $ S$ and $ \chi = X \times S$ .

($ X$ is convex,nonsingular variety)

My question is that how can we use above lemma to prove that $ \mu$ lies in closure of locus of maps with irreducible domain?

Which interesting characterestic zero field $E$ (e.g a pseudofinite field) can support a Weil cohomology?

Let’s consider the category of smooth projective varieties over a fixed characteristic $ p>0$ algebraic closed field $ k$ . For a Weil cohomology theory with coefficient field $ E$ , by definition it shall satisfy finiteness property, Poincare duality, Kunneth formula, existence of cycle maps, weak and hard Lefschetz theorem.

Consider the class $ \mathcal {C}$ of characterestic zero fields $ E$ that support a Weil cohomology. Not all fields of zero characteristic can be a coeffiecient field, as is discussed in Serre’s example of a supersingular elliptic curve over $ k$ . We know

  • $ E \in \mathcal {C} \Rightarrow E$ can’t embedded into $ \mathbb R$ .
  • For $ E_1 \hookrightarrow E_2$ , $ E_1 \in \mathcal {C} \Rightarrow E_2 \in \mathcal {C}$ .

  • $ \mathbb Q_l \in \mathcal {C}$ $ (l \not = p)$ .

  • $ W(k)[1/p] \in \mathcal {C}$ .

More interestingly, we also know some pseudofinite field lie in $ \mathcal C$ , namely the ultraproduct of $ \mathbb F_l$ $ (l \not =p)$ using a non-principal ultrafilter, see “a new Weil cohomology theory” by Ivan Tomasic. And there is a dicussion of Weil II for such Weil cohomology theory, see https://webusers.imj-prg.fr/~anna.cadoret/Weil2Ultra_OberwolfachReports.pdf。

So my question is, can we describe other interesting field in $ C$ ?

ext2 – all files are size zero

I’m working on a legacy system, hence ext2. I’m booting linux with syslinux. I create an blank disk image with dd and /dev/zero, then I partition it into 2 partitions with parted and create the file systems. One filesystem is fat32 and the other is ext2. I have to use ext2 and not FAT32 since I’m bumping into the maximum number of files in a FAT32 directory (previous poor system design decisions that I can’t change at this point). After making the file systems, I put syslinux on one partition, and then copy all the system’s assets (graphics and sounds) to the second partition. Now I have a bin file that I can dd to a CF card (yes cf cards, it’s legacy but needs maintenance).

Linux boots correctly every time.

The problem is after boot: Sometimes this works perfectly and other times it doesn’t. The ext2 partition will mount but it lists all the file sizes as zero, other times everything works. I can’t figure out any pattern to it.

What could be the cause for a filesystem to intermittently mount, list the files, but show all the file sizes as zero?