SSHing into a RasPi while an openVPN connection is active for all IPs not within the local 10.* network

I would like to be able to SSH into my raspi; which I can do so over the wlan0 interface if it simplifies things.

All other connections Id like to be routed through an openvpn connection at interface tun0.

What Im hoping for is the openvpn configurations or the iptables routing that allows me to ssh into my raspi, while openvpn is active.

Restated:

  • Between my local network and the raspi, dont use the VPN
  • Between my raspi and everything outside my local network, use the VPN

ifconfig on my primary machine (connected over wireless)

$   ifconfig    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384     options=3<RXCSUM,TXCSUM>     inet6 ::1 prefixlen 128      inet 127.0.0.1 netmask 0xff000000      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1      nd6 options=1<PERFORMNUD> en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500     ether ac:bc:32:93:36:c7      inet6 fe80::aebc:32ff:fe93:36c7%en0 prefixlen 64 scopeid 0x4      inet6 2601:643:8500:614:aebc:32ff:fe93:36c7 prefixlen 64 autoconf      inet6 2601:643:8500:614:cbb:be12:9871:b2b4 prefixlen 64 autoconf temporary      inet 10.0.0.224 netmask 0xffffff00 broadcast 10.0.0.255     inet6 2601:643:8500:614::a8ce prefixlen 64 dynamic      nd6 options=1<PERFORMNUD>     media: autoselect     status: active  en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500     ether 0b:0b:0b:0b:0b:0b      inet6 fe80::aebc:32ff:fe93:36c7%en5 prefixlen 64 scopeid 0x7      inet 169.254.105.195 netmask 0xffff0000 broadcast 169.254.255.255     nd6 options=1<PERFORMNUD>     media: autoselect (10baseT/UTP <full-duplex>)     status: active  awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1452     ether f6:1e:4f:ec:7b:b8      inet6 fe80::f41e:4fff:feec:7bb8%awdl0 prefixlen 64 scopeid 0x9      nd6 options=1<PERFORMNUD>     media: autoselect     status: active 

ifconfig on the RasPi (connected with a hard-wire ethernet)

$   ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 10.0.0.130  netmask 255.255.255.0  broadcast 10.0.0.255         ether b8:27:eb:4d:28:33  txqueuelen 1000  (Ethernet)         RX packets 130  bytes 17325 (16.9 KiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 62  bytes 9923 (9.6 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         loop  txqueuelen 1000  (Local Loopback)         RX packets 0  bytes 0 (0.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 0  bytes 0 (0.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 10.0.0.155  netmask 255.255.255.0  broadcast 10.0.0.255         ether b8:27:eb:18:7d:66  txqueuelen 1000  (Ethernet)         RX packets 66  bytes 9976 (9.7 KiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 16  bytes 2116 (2.0 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 

MySQLi connection fails

Hi

I'm attempting to design a new web site and connect to the MySQL database.

Unfortunately the last time I coded was years ago and the syntax has updated

[01-Dec-2018 13:43:43 UTC] PHP Fatal error: Class 'mysqli_connect' not found in

I think its an error of not defining the connection properly.

I've tried looking at the Oracle help / forum (yes I signed up) but can't see in initial set up tutorial that goes through the basics so that I can verify I have everything in place.

This is…

MySQLi connection fails

Percona XtraDB Cluster: Failed to report last committed , -110 (Connection timed out)

I’m using Percona-XtraDB-Cluster-server-56 with Version : 5.6.39 Release : 26.25.1.el6.

with 2 node PXC + 1 percona-xtradb-cluster-garbd.

I’m facing following problem. PXC log report a a lot of warning

2018-11-19 17:33:48 19414 [Warning] WSREP: Failed to report last committed 1327742612, -110 (Connection timed out) 2018-11-19 19:07:06 19414 [Warning] WSREP: Failed to report last committed 1327963155, -110 (Connection timed out) 2018-11-19 19:26:58 19414 [Warning] WSREP: Failed to report last committed 1328000375, -110 (Connection timed out) 2018-11-19 21:11:49 19414 [Warning] WSREP: Failed to report last committed 1328209550, -110 (Connection timed out) 2018-11-19 23:44:14 19414 [Warning] WSREP: Failed to report last committed 1328381758, -110 (Connection timed out) 2018-11-20 09:31:48 19414 [Warning] WSREP: Failed to report last committed 1328978200, -110 (Connection timed out) 2018-11-20 09:43:42 19414 [Warning] WSREP: Failed to report last committed 1329040974, -110 (Connection timed out) 2018-11-20 09:46:06 19414 [Warning] WSREP: Failed to report last committed 1329052427, -110 (Connection timed out) 2018-11-20 10:20:36 19414 [Warning] WSREP: Failed to report last committed 1329227873, -110 (Connection timed out) 2018-11-20 10:28:20 19414 [Warning] WSREP: Failed to report last committed 1329265424, -110 (Connection timed out) 2018-11-20 11:03:22 19414 [Warning] WSREP: Failed to report last committed 1329453317, -110 (Connection timed out) 2018-11-20 11:23:47 19414 [Warning] WSREP: Failed to report last committed 1329559539, -110 (Connection timed out) 2018-11-20 11:25:00 19414 [Warning] WSREP: Failed to report last committed 1329564657, -110 (Connection timed out) 2018-11-20 11:33:53 19414 [Warning] WSREP: Failed to report last committed 1329604492, -110 (Connection timed out) 2018-11-20 11:57:34 19414 [Warning] WSREP: Failed to report last committed 1329715728, -110 (Connection timed out) 2018-11-20 13:42:23 19414 [Warning] WSREP: Failed to report last committed 1330147628, -110 (Connection timed out) 2018-11-20 13:43:00 19414 [Warning] WSREP: Failed to report last committed 1330149773, -110 (Connection timed out) 2018-11-20 14:27:01 19414 [Warning] WSREP: Failed to report last committed 1330379363, -110 (Connection timed out) 2018-11-20 14:30:12 19414 [Warning] WSREP: Failed to report last committed 1330391879, -110 (Connection timed out) 2018-11-20 14:32:14 19414 [Warning] WSREP: Failed to report last committed 1330401771, -110 (Connection timed out) 2018-11-20 14:34:41 19414 [Warning] WSREP: Failed to report last committed 1330411552, -110 (Connection timed out) 2018-11-20 14:35:15 19414 [Warning] WSREP: Failed to report last committed 1330413554, -110 (Connection timed out) 2018-11-20 14:36:37 19414 [Warning] WSREP: Failed to report last committed 1330419814, -110 (Connection timed out) 2018-11-20 14:37:26 19414 [Warning] WSREP: Failed to report last committed 1330422477, -110 (Connection timed out) 2018-11-20 14:41:02 19414 [Warning] WSREP: Failed to report last committed 1330437542, -110 (Connection timed out) 2018-11-20 14:50:49 19414 [Warning] WSREP: Failed to report last committed 1330484259, -110 (Connection timed out) 2018-11-20 14:57:32 19414 [Warning] WSREP: Failed to report last committed 1330517211, -110 (Connection timed out) 2018-11-20 15:01:34 19414 [Warning] WSREP: Failed to report last committed 1330536212, -110 (Connection timed out) 2018-11-20 15:43:19 19414 [Warning] WSREP: Failed to report last committed 1330769642, -110 (Connection timed out) 2018-11-20 15:50:59 19414 [Warning] WSREP: Failed to report last committed 1330808893, -110 (Connection timed out) 2018-11-20 15:59:07 19414 [Warning] WSREP: Failed to report last committed 1330848316, -110 (Connection timed out) 2018-11-20 16:08:41 19414 [Warning] WSREP: Failed to report last committed 1330891310, -110 (Connection timed out) 2018-11-20 16:10:22 19414 [Warning] WSREP: Failed to report last committed 1330898081, -110 (Connection timed out) 2018-11-20 16:13:43 19414 [Warning] WSREP: Failed to report last committed 1330913054, -110 (Connection timed out) 2018-11-20 16:19:46 19414 [Warning] WSREP: Failed to report last committed 1330940790, -110 (Connection timed out) 2018-11-20 16:23:10 19414 [Warning] WSREP: Failed to report last committed 1330954782, -110 (Connection timed out) 2018-11-20 16:23:53 19414 [Warning] WSREP: Failed to report last committed 1330957407, -110 (Connection timed out) 2018-11-20 16:26:01 19414 [Warning] WSREP: Failed to report last committed 1330967791, -110 (Connection timed out) 2018-11-20 16:29:57 19414 [Warning] WSREP: Failed to report last committed 1330984126, -110 (Connection timed out) 2018-11-20 16:32:22 19414 [Warning] WSREP: Failed to report last committed 1330994398, -110 (Connection timed out) 2018-11-20 16:40:44 19414 [Warning] WSREP: Failed to report last committed 1331034549, -110 (Connection timed out) 2018-11-20 16:49:01 19414 [Warning] WSREP: Failed to report last committed 1331068494, -110 (Connection timed out) 2018-11-20 17:09:53 19414 [Warning] WSREP: Failed to report last committed 1331161202, -110 (Connection timed out) 2018-11-20 17:10:53 19414 [Warning] WSREP: Failed to report last committed 1331164772, -110 (Connection timed out) 

It make any SQL transaction like insert and update in commit stage very slow everytime that log occur, usual take 10-11 sec to finish. Normaly that sql only take less then 1 second.

The ping between 2 node PXC is less than 0.2ms, and no drop package.

Following is my.conf. (similar on 2 node)

[client] default-character-set = utf8mb4 [mysql] default-character-set = utf8mb4 # CLIENT # port = 3306 socket = /u01/mysql-data/mysql/mysql.sock [mysqld] character-set-client-handshake = TRUE init-connect='SET NAMES utf8mb4' character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci  lower_case_table_names=1 # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0  # Path to Galera library wsrep_provider=/usr/lib64/libgalera_smm.so  # Cluster connection URL contains IPs of node#1, node#2 wsrep_cluster_address=gcomm://192.168.5.50,192.168.5.123,192.168.5.124 # In order for Galera to work correctly binlog format should be ROW binlog_format=ROW # MyISAM storage engine has only experimental support default_storage_engine=InnoDB # This changes how InnoDB autoincrement locks are managed and is a requirement for Galera innodb_autoinc_lock_mode=2 # Node #6 address wsrep_node_address=192.168.5.124 # Cluster name wsrep_cluster_name=my_centos_cluster # SST method wsrep_sst_method=xtrabackup-v2 #Authentication for SST method wsrep_sst_auth="sstuser:secret" # GENERAL # user = mysql default-storage-engine = InnoDB socket = /u01/mysql-data/mysql/mysql.sock pid-file = /u01/mysql-data/mysql/mysql.pid # MyISAM # key-buffer-size = 32M myisam-recover-options = FORCE,BACKUP # SAFETY # max-allowed-packet = 16M max-connect-errors = 1000000 sql-mode = ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE # DATA STORAGE # datadir = /u01/mysql-data/mysql/ # BINARY LOGGING # log-bin = /u01/mysql-data/mysql/mysql-bin expire-logs-days = 14 sync-binlog = 1 # CACHES AND LIMITS # tmp-table-size = 32M max-heap-table-size = 32M query-cache-type = 0 query-cache-size = 0 max-connections = 1000 thread-cache-size = 200 open-files-limit = 65535 table-definition-cache = 4096 table-open-cache = 4096 # INNODB # innodb-flush-method = O_DIRECT innodb-log-files-in-group = 2 innodb-log-file-size = 512M innodb-flush-log-at-trx-commit = 1 innodb-file-per-table = 1 innodb-buffer-pool-size = 42G # LOGGING # log-error = /u01/mysql-data/log/mysql-error.log log-queries-not-using-indexes = 1 slow-query-log = 0 slow-query-log-file = /u01/mysql-data/log/mysql-slow.log tmpdir = /u01/mysql-data/tmp-dir 

Did I missing some config? How to solve that problem?

Cloud to on premise connection

For an application hosted in the cloud, how to push requests to clients in customer lab/on-premise in real-time?

Main concerns are:

  1. clients may not allow in-coming connections
  2. clients behind firewall
  3. want the requests to be received in real time, hence push is preferred over pull

How to go about building such system? Any open source componets can do this?

Thanks:

asp.net websocket connection reset by peer

I’m working with web socket in asp.net mvc and created a websocket handler to handle websocket requests the problem is when a client(android app) connects to server using websocket after a few sec(i think 30 sec) the connection is closed, and in android studio i got this error

java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer) 

i have searched and tried some of solutions but cannot to solve it

this is my websocket handler test.ashx in asp.net mvc web application:

 public class WSHttpHandler : IHttpHandler {      public void ProcessRequest(HttpContext context)      {         try         {             if (context.IsWebSocketRequest)             {                 context.AcceptWebSocketRequest(new TestWebSocketHandler());              }          }         catch (Exception ex)         {             // log exception         }     }  } 

and TestWebSocketHandler.cs:

 public class TestWebSocketHandler : WebSocketHandler  {       public override void OnOpen()      {      }       public override void OnMessage(string message)     {      }       public override void OnClose()      {      }  } 

mount_smbfs: server rejected the connection: Authentication error on Mac OS High Sierra 10.13.6

On my ubuntu server i have a few shares that I can access from finder in the style:

smb://server.domain/share 

successfully without having to type in a password. When I try to mount the server shares from the command line with:

mount_smbfs '//share;user:@server.domain/share' /Volumes/share 

I get

mount_smbfs: server rejected the connection: Authentication error 

If i mount one of the shares from the finder all others can be mounted from the command line without this error to appear.

I searched the different stackexchange sites and found the following releated questions and links:

  • https://superuser.com/questions/1269386/why-cant-i-mount-shares-by-smb-since-high-sierra
  • Why mac smb connect fails with login from cli but works from finder and with guest account?
  • SMB connections throws authentication error after upgrading Mac OS X to 10.13
  • https://serverfault.com/questions/367950/secure-way-to-mount-a-password-protected-cifs-share-in-mac
  • https://support.apple.com/en-us/HT208209
  • Mac OS Sierra connected to SMB share keeps forgetting permissions at the folder level

Most of these have a few thousand views and quite a few upvotes. Most interestingly I found two comments where users express the frustration about this issue not being solved in a consistent way.

On the other hands there are lots of downvotes for answers and some of the questions – it seems as this problem is very well known and some enlighted users think it is very clear what to do.

Since this issue is annoying me daily I am daring to ask the question again with the specific context of Ubuntu 16.04 LTS and Mac OS High Sierra 10.13.6.

I fear that answers of the past do not work in this context any more.

The reasons I am asking the question in the first place is that the SMB connections get “lost” over night. This is a different behavior then on my other systems. The CIFS connection between my Ubuntu machines stay stable over time while Mac OS seems to have some disconnection policy.

So my issue could either be solve by making the connection stable or re-establishing the connection automatically with a script

How can a permanent or automatically-script reconnected SMB connection between a Mac OS High Sierra 10.3.6 client and an Ubuntu/Linux SMB server achieved?

a torsion-free connection that preserves a complex structure

Let $ (M,I)$ be a complex manifold with a complex structure $ I$ , i.e. an endomorphism $ I$ of the tangent bundle such that $ I^2 = -Id$ and such that the subbundle $ T^{1,0}$ of eigenvectors of $ I \otimes \mathbb{C}$ with eigenvalue $ i$ in $ TM \otimes \mathbb{C}$ is involutive.

How to construct a torsion free connection such that $ \nabla(I)=0$ ?