forward packet between eth0 and tun0:
iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
to save iptables rules
| function findInDb(dbName, collectionIdToFind) { | |
| var dbToSearch = db.getSiblingDB(dbName); | |
| var collectionNames = dbToSearch.getCollectionNames(); | |
| for (var i = 0; i < collectionNames.length; i++) { | |
| var name = collectionNames[i]; | |
| var stats = dbToSearch.getCollection(name).stats({ | |
| "indexDetails": true | |
| }); | |
| var uris = [stats.wiredTiger.uri]; |
| // Hobab Abshodeh Fardai | |
| AbshodeFardai - ((Gold*AfsharFardai)/9.5742) | |
| // Hobab Abshodeh Naghdi | |
| AbshodeNaghdi - ((Gold*AfsharNaghdi)/9.5742) | |
| // Hobab Sekke Fardai | |
| SekkeFardai - ((Gold*AfsharFardai)*0.23533) | |
| // Hobab Sekke Naghdi |
| ip tuntap add dev tun1 mode tun | |
| ip addr add 10.0.0.1/24 dev tun1 | |
| ip link set tun1 up | |
| ip route add 8.8.8.8/32 via metric 5 | |
| ip route add 8.8.8.8/32 via 192.168.1.1 metric 5 | |
| ip route add 8.8.4.4/32 via 192.168.1.1 metric 5 | |
| ip route add 157.119.188.28 via 192.168.1.1 metric 5 | |
| badvpn-tun2socks --tundev tun1 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 157.119.188.28:9991 --username USERNAME --password PASSWORD | |
| ip route add default via 10.0.0.2 metric 6 |
docker run -d \
--name pihole \
--net=host \
-e TZ="Asia/Tehran" -e WEBPASSWORD="13257106" -e ServerIP="192.168.1.100" -e WEB_PORT="8080" -e DNSMASQ_LISTENING="all" \
-v "$(pwd)/etc-pihole/:/etc/pihole/" \
-v "$(pwd)/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
--dns=1.0.0.1 --dns=1.0.0.1 \
--restart=unless-stopped \
--cap-add=NET_ADMIN \
pihole/pihole:latest
| const host = `api/${token}`; | |
| const config = { | |
| // debug: true, // uncomment this line to see Library errors and warnings in the console | |
| // fullscreen: true, | |
| width: "100%", | |
| height: "100%", | |
| container_id: "tv_chart_container", //id of div which you wanna load chart | |
| symbol: "AbshodeN", | |
| interval: "1", | |
| timezone: "Asia/Tehran", |
if you run an app containing farsi (persian) words, and it doesn't display well, you can use the following approach:
open terminal and cd to app directory run app with the command:
LC_ALL=fa_IR.utf8 wine terminal.exe
which terminal.exe is the name of the app.
if it doesn't fix it you may also need to install Core Font Pack with this command:
Change all files to 644
$ find ./ -type f -exec chmod 644 {} \;
Change all folders to 755
$ find ./ -type d -exec chmod 755 {} ;
We're going to create a service called asakchart.
create and edit asakchart.service:
nano /etc/systemd/system/asakchart.service
with following content:
[Unit]
Description=Asakchart Webserivce
Open terminal:
$ mongo
> use admin
> db.createUser({
user: "username",
pwd: "password",
roles: [ { role: "root", db: "admin" } ]
});
> exit