How to setup network proxy in KDE desktop system? - console

I want to setup network proxy in KDE desktop system. I have found how to setup it in gnome desktop system:
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.socks host '127.0.0.1'
gsettings set org.gnome.system.proxy.socks port 1080
But this not works in KDE. I always tried the following but not works.
kwriteconfig --file kioslaverc --group 'Proxy Settings' --key ProxyType "1"
kwriteconfig --file kioslaverc --group 'Proxy Settings' --key httpProxy "http://127.0.0.1:1080"
kwriteconfig --file kioslaverc --group 'Proxy Settings' --key Authmode 0
# When you modify kioslaverc, you need to tell KIO.
dbus-send --type=signal /KIO/Scheduler org.kde.KIO.Scheduler.reparseSlaveConfiguration string:''
These commands are referred to https://github.com/j1ml/proxydriver/blob/master/proxydriver.sh

I have learned that you need to use kwriteconfig5 because kwriteconfig is the kdelibs4 version and returns the KDE 4 configuration paths.
Hope it helps.

Related

Setting up the EFI Shell in Qemu to allow for Http requests

I am developing an UEFI App that will need to perform a GET request through http.
As a start up point, I want to make sure my setup is working properly so that the http requests can actually go through.
To that end, I spent the last few days trying to make the http command work in the EFI Shell launched inside QEMU.
I can get the ping command to work properly, but calling:
http httpbin.org/get
Always returns: 
Unable to open http protocol on `eth0` - Unsupported
Unable to download the file `/get` on `eth0` - Unsupported
This is my startup.nsh script to configure the EFI Shell's interface:
connect
ifconfig -r eth0
ifconfig -s eth0 dhcp
ifconfig -l eth0
These were my different attempts at invoking Qemu properly:
-netdev user,id=mynet0,hostfwd=tcp::8080-:80 -device e1000,netdev=mynet0 \
        -netdev user,id=user.0 -device e1000,netdev=user.0 \
        -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 \
       
And following this guide I tried to setup a tap, albeit without luck, I'd launch qemu with the following configuration:
-netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 \
Do you have any clue what step am I missing?
Where do you believe I could be failing in making eth0 supported?
Is the tap crucial?
Are you able to make this setup work on your side?
Update:
Very good suggestion #MiSimon, I hadn't realized that the HttpDxe driver wasn't being built with the OvmfPkg.
I have now added its INF to OvmfPkgX64.dsc and OvmfPkgX64.fdf.
Although, running drivers is displaying a duplicate entry:
0000000A D - - 1 - HttpDxe HttpDxe
0000000A ? - - - - HttpDxe HttpDxe
With respect to calling the http command, the error has progressed to:
Downloading 'http://httpbin.org/get'
Unable to download the file '/get' on 'eth0' - Unsupported
The debug log shows:
HttpNotify: Event - 0, EventStatus - Unsupported
Error: Could not retrieve the host address from DNS server.
The tool requires nearly all network drivers to be loaded.
Make sure your image contains the following drivers:
SnpDxe
MnpDxe
ArpDxe
Ip4Dxe/Ip6Dxe
Dhcp4Dxe/Dhcp6Dxe
Udp4Dxe/Udp6Dxe
DnsDxe
TcpDxe
HttpDxe
HttpUtilitiesDxe
All of them are can be found in EDK2 inside the NetworkPkg.

Is there a way to view NATS messages?

I am trying to look at the messages in a NATS cluster on a certain topic.
My google searches led to https://github.com/KualiCo/nats-streaming-console and https://hub.docker.com/r/fjudith/nats-streaming-console but neither npm install nor yarn install worked. I am not sure if thats an issue with the image or if thats my system setting.
And since I am new here, I wasn't allowed to comment.
I have been running in circles for sometime with this so any pointers would be highly appreciated.
-Suresh
Use the nats CLI tool (https://github.com/nats-io/natscli/releases/):
To look at the messages being published on subject foo for example just use nats sub foo.
Note that NATS-Streaming (aka STAN) is now deprecated and replaced by JetStream which is built-in to the nats.io server.
You can use WEB UI (not good as in rabbit, but..) It's forked version of nats-webui. I am not maintainer, but it works. Also it can work with auth tokens.
Github: https://github.com/suisrc/NATS-WebUI
DockerHub: https://hub.docker.com/r/suisrc/nats-webui/tags
Maybe this is not what you are looking for on a cluster (but could be).
Nevermind, in case of a single NATS instance, using the CLI-tools:
General access:
nats --user username --password mypassword --server localhost:PORT
Listing the streams:
nats --user username --password mypassword --server localhost:PORT stream ls
Subscribing (a shell) onto a streams:
nats --user username --password mypassword --server localhost:PORT subscribe SUBJECT.STREAM
Publish a "JSON message" onto a stream:
cat <PathToMessage.json> | nats --user username --password mypassword --server localhost:PORT publish SUBJECT.STREAM --force-stdin
Show all messages published onto a Stream:
nats --user username --password mypassword --server localhost:PORT stream view
Additionally: Sample JSON Message:
{
"id": "4152c2e7-f2be-42d8-86fe-5b94f2ed3678",
"form": "triangle",
"wrappedData": {
"Color": "green",
}
}

Windows 10 IoT Core - netsh http not found

Running
netsh http add sslcert hostnameport=xxx:443 appid= 'XXX' certhash=XXX certstorename=MY clientcertnegotiation=enable
I get
The following command was not found: http add sslcert hostnameport=xxx:443 appid= 'XXX' certhash=XXX certstorename=MY clientcertnegotiation=enable
Seems that "http" doesn't exist in netsh of Windows 10 IoT Core.
Any workaround to solve it?
Windows IoT Core doest not support netsh http command. If you want to import the ssl certificate on Windows IoT Core. You can use following command:
Copy cert to C:\ on the device.
PS C:> Enter-PSSession -ComputerName -Credential Administrator
[]: PS C:\Data\Users\Administrator\Documents> cd C:\
[]: PS C:>Set-Location -Path cert:\LocalMachine\Root
[]: PS Cert:\LocalMachine\Root> Import-Certificate -Filepath C:***.pem, if your certificate file is pfx, you can use Import-PfxCertificate command instead.
In addition, you can also import the certificate using programming. More information please see here.

How to connect to Kafka cluster with Kerberos Authentication on Windows using the Cofluent library?

I'm working on a project which requires me to connect to an existing Kafka cluster using dotnet and the Confluent library. The Kafka cluster uses Kerberous/Keytab authentication. Looking at some of the documentation it looks like you can pass through the keytab file using the JAAS configuration, but when I look at the properties for the ProudcerConfig in Confluent I don't see anything about authentication. So how do I specify the keytab file so that I can authenticate against the Kafka cluster?
I think this section of Confluent docs mentions how to configure clients:
In your client.properties file you'd need the following configuration:
sasl.mechanism=GSSAPI
# Configure SASL_SSL if SSL encryption is enabled, otherwise configure SASL_PLAINTEXT
security.protocol=SASL_SSL
sasl.kerberos.service.name=kafka
sasl.jaas.config=com.sun.security.auth.module.Krb5LoginModule required \
useKeyTab=true \
storeKey=true \
keyTab="/etc/security/keytabs/kafka_client.keytab" \
principal="kafkaclient1#EXAMPLE.COM";
# optionally - kafka-console-consumer or kafka-console-producer, kinit can be used along with useTicketCache=true
sasl.jaas.config=com.sun.security.auth.module.Krb5LoginModule required \
useTicketCache=true;
In order to pass client.properties to e.g. kafka-console-consumer you need to provide --consumer.config parameter as well:
For Linux:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --consumer.config client.properties --from-beginning
For Windows:
bin/kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --consumer.config client.properties --from-beginning

managemnt tab in kaa sandbox URL

I created Kaa sandbox instance on the AWS Linux host. I am getting some of the issues
Still I am not able to see the management button on the kaa Sandbox console.
I am not able to connect AWS with using ssh. I followed all the required step to connect to AWS Linux host, but not lucky to connect.
My problem is that, I would like to change the host IP in the sandbox setting with my AWS linux host IP, so that my end point device gets connected to host,
Still I am struggling with above points. Please advise.
Regards,
Prasad
That seems to be an issue with the Kaa 0.10.0 Sandbox for AWS. We created a bug for tracking this.
For now, you can use the next workaround:
echo "sudo sed -Ei 's/(gui_change_host_enabled=).*$/\1true/'" \
"/usr/lib/kaa-sandbox/conf/sandbox-server.properties;" \
"sudo service kaa-sandbox restart" | \
ssh -i <your-private-aws-instance-key.pem> ubuntu#<your-aws-instance-host>
Note: this is a multi-line single command that works correctly in bash (should also work in sh and others, but that is not tested).
Note 2: don't forget to replace
<your-private-aws-instance-key.pem>
<your-aws-instance-host>
with the respective key name and host name/IP address.

Resources