SSH connection with Java

Use JSch import com.jcraft.jsch.*; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Scanner; /** * @author World */ public class SSHReadFile { public static void main(String args[]) { String user = “john”; String password = “mypassword”; String host = “192.168.100.23”; int port = 22; String remoteFile = “/home/john/test.txt”; try { JSch jsch = new JSch(); Session session = … Read more

When to close db connection on android? Every time after your operation finished or after your app exit

I don’t know of any performance penalties in frequent closing/opening of the database (regardless of its size). I think the answer to this question also depends on what type of application is accessing the database. Do you “re-query” the database a lot? Then it seems rectified to keep it open. Do you fetch different data … Read more

No internet connection on WSL Ubuntu (Windows Subsystem for Linux) [closed]

The reason this error occurs is because Windows automatically generates resolv.conf file with wrong nameserver. To resolve this issue, follow the following steps. Locate the file by running the following command: sudo nano /etc/resolv.conf You will see the following in the file: # This file was automatically generated by WSL. To stop automatic generation of … Read more

php connection pooling mysql [duplicate]

have you ever used mysql_pconnect() ? mysql_pconnect() acts very much like mysql_connect() with two major differences. First, when connecting, the function would first try to find a (persistent) link that’s already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new … Read more

How to check the Internet connection with .NET, C#, and WPF

Many developers are solving that “problem” just by ping-ing Google.com. Well…? :/ That will work in most (99%) cases, but how professional is to rely work of Your application on some external web service? Instead of pinging Google.com, there is an very interesting Windows API function called InternetGetConnectedState(), that recognizes whether You have access to … Read more

Bad state: Insecure HTTP is not allowed by platform: [closed]

For Android: This behavior may be omitted following migration guide: https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android. or… Just add in android/app/src/main/AndroidManifest.xml: android:usesCleartextTraffic=”true” to <application /> also dont forget to take INTERNET PERMISSION: <uses-permission android:name=”android.permission.INTERNET” /> <!– This Line –> <application android:name=”io.flutter.app.FlutterApplication” android:label=”receipt” android:usesCleartextTraffic=”true” <!– This Line –> android:icon=”@mipmap/ic_launcher”> For iOS: Allow insecure/HTTP requests globally across your application on iOS, you … Read more

Apache Server (xampp) doesn’t run on Windows 10 (Port 80)

I had the same problem on windows 10, IIS/10.0 was using port 80 To solve that: find service “W3SVC” disable it, or set it to “manual” French name is: “Service de publication World Wide Web“ English name is: “World Wide Web Publishing Service“ german name is: “WWW-Publishingdienst” – thanks @fiffy Polish name is: “Usługa publikowania … Read more

tech