ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE error in FreeRDP
By admin | April 8, 2023
xfreerdp /v:rdp_server_address /admin /network:auto /u:username /p:password
Connecting to a Windows 10 machine yielded the following error.
https://github.com/FreeRDP/FreeRDP/issues/6604 hints in https://github.com/FreeRDP/FreeRDP/issues/6604#issuecomment-746104066 that it might be an issue of hardware acceleration.
The solution is to disable RemoteFX for remote desktop.
[15:38:35:887] [24159:24160] [DEBUG][com.freerdp.core.rdp] - recv Set Error Info Data PDU (0x2F), length: 22 [15:38:35:887] [24159:24160] [INFO][com.freerdp.core] - ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE (0x00000011):The display driver in the remote session was unable to complete all the tasks required for startup. [15:38:35:887] [24159:24160] [ERROR][com.freerdp.core] - rdp_set_error_info:freerdp_set_last_error_ex ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE [0x00010011]
Topics: Windows | No Comments »
Scala.js – Referring to non-existent class
By admin | September 9, 2021
Referring to non-existent class MyClass$
called from JSClass$.jsMethod()void
called from JSClass$.$js$exported$meth$jsMethod()java.lang.Object
exported to JavaScript with @JSExport
involving instantiated classes:
JSClass$
exported to JavaScript with @JSExport
Cannot access module for non-module MyClass$
called from JSClass$.jsMethod()void
called from JSClass$.$js$exported$meth$jsMethod()java.lang.Object
exported to JavaScript with @JSExport
involving instantiated classes:
JSClass$
exported to JavaScript with @JSExport
Related issue: https://github.com/scala-js/scala-js/issues/629
If the issue is coming from a shared module being used in both a Scala.js and JVM setting, the issue may be that the shared module is not being compiled for Scala.js. We can fix that as follows by compiling it for both. Mill example below:
object MyObject extends ScalaModule with ScalaJSModule with ScalafmtModule {
// ...
}
// Instead of
object MyObject extends ScalaModule with ScalafmtModule {
// ...
}
Topics: Code | No Comments »
Serving VNC via HTML5 using noVNC and x11vnc
By admin | July 22, 2021
# May need to set up x11vnc password beforehand!
# -forever and -loop are important to makes sure it keeps working
nohup x11vnc -create -forever -loop -usepw &
# noVNC
git clone https://github.com/novnc/noVNC.git --depth 2
cd noVNC
# Set up SSL
openssl req -x509 -nodes -newkey rsa:2048 -keyout novnc.pem -out novnc.pem -days 180
nohup ./utils/novnc_proxy --vnc localhost:5900 --cert novnc.pem --ssl-only --listen 443 &
Topics: (X)HTML, HTTP (Internet), Linux | No Comments »
Accessing SQL databases from Scala
By admin | July 21, 2021
import scalikejdbc._
import scalikejdbc.scalikejdbcSQLInterpolationImplicitDef
// initialize JDBC driver & connection pool
Class.forName("org.postgresql.Driver")
scalikejdbc.ConnectionPool.singleton("jdbc:postgresql://localhost:5432/", "user", "abcdef888")
sql"""
create table members (
id serial not null primary key,
fav_num integer NOT NULL,
name text NOT NULL
)
""".execute.apply()(scalikejdbc.AutoSession)
sql"""
INSERT INTO members (name, fav_num) VALUES ('Foo', 123)
""".execute.apply()(scalikejdbc.AutoSession)
sql"""
INSERT INTO members (name, fav_num) VALUES ('Bar', 456)
""".execute.apply()(scalikejdbc.AutoSession)
// http://scalikejdbc.org/documentation/operations.html
scalikejdbc.DB.readOnly { implicit session =>
sql"select * from members".foreach { (rs: scalikejdbc.WrappedResultSet) =>
println(rs.toMap())
}
}
You can run the database with Docker (example) as follows:
docker run --name mypsql -e POSTGRES_USER=user -e POSTGRES_PASSWORD=abcdef888 -p 5432:5432 postgres:13.3
Reference instructions for connecting to the docker instance:
psql -h localhost -U user
\dt
select * from members;
Topics: Code | No Comments »
Local build in npm
By admin | May 24, 2021
npm install # Install dependencies
npm run build # Needs a like like "build": "tsc" in package.json. For TypeScript, just run tsc directly if missing
npm install -g # Installed compiled result to global packages
Topics: Code | No Comments »
Python classes, metaclasses, and instances at a glance
By admin | February 16, 2021
For more details: http://www.thedigitalcatonline.com/blog/2014/09/01/python-3-oop-part-5-metaclasses/

Topics: Code | No Comments »
git-strip-above
By admin | February 15, 2021
git format-patch $1..HEAD -o wip && git reset --hard $1
Topics: Code | No Comments »
Getting files from sources in Scala
By admin | February 14, 2021
// Java-based ways getClass.getResource("/html/myfile.html") println(Source.fromInputStream(getClass.getResourceAsStream("/html/myfile.html")).mkString) // Scala-native way // Note: NO LEADING SLASH println(Source.fromResource("html/myfile.html").getLines.toList)
Topics: Code | 3 Comments »
Epson DS-30 on Ubuntu Linux
By admin | February 13, 2021
https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1728012/comments/36
Use the attached ds-30-bundle, download from
http://support.epson.net/linux/en/iscan.php?model=ds-30&version=1.0.1
Install the deb packages with ./install.sh –dry-run
Use simple-scan to run the scan. Insert paper face down above/next to
the little scan marker and press the button
Topics: Linux | No Comments »
Running a GUI application in Docker
By admin | January 30, 2021
apt-get update && apt-get install -y openssh-server vim xpra
# Allow container to connect to GUI?
xhost +
docker run --rm -v /tmp/.X11-unix:/tmp/.X11-unix -p 2222:2222 -e DISPLAY --security-opt seccomp:unconfined -it <image> bash
sudo mkdir -p /run/user/1000
sudo chown ubuntu:ubuntu /run/user/1000
xpra start ssh:ubuntu@localhost:2222 --exit-with-children --start-child="xfce4-terminal"
Topics: Linux | 1 Comment »