Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
gjs /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
calc.js
3.59
KB
-rw-r--r--
dbus-client.js
4.73
KB
-rw-r--r--
dbus-service.js
3.43
KB
-rw-r--r--
gettext.js
630
B
-rw-r--r--
gio-cat.js
733
B
-rw-r--r--
glistmodel.js
3.73
KB
-rw-r--r--
gtk3-template.js
1.54
KB
-rw-r--r--
gtk3-template.ui
1.61
KB
-rw-r--r--
gtk4-template.js
1.59
KB
-rw-r--r--
gtk4-template.ui
1.61
KB
-rw-r--r--
gtk-application.js
3.65
KB
-rw-r--r--
gtk.js
2.53
KB
-rw-r--r--
http-client.js
1.4
KB
-rw-r--r--
http-server.js
1.19
KB
-rw-r--r--
README
77
B
-rw-r--r--
test.jpg
35.55
KB
-rw-r--r--
test.jpg.license
158
B
-rw-r--r--
timers.js
434
B
-rw-r--r--
webkit.js
485
B
-rw-r--r--
websocket-client.js
1.41
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : dbus-service.js
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later // SPDX-FileCopyrightText: 2020 Andy Holmes <andrew.g.r.holmes@gmail.com> 'use strict'; const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; /* * An XML DBus Interface */ const ifaceXml = ` <node> <interface name="org.gnome.gjs.Test"> <method name="SimpleMethod"/> <method name="ComplexMethod"> <arg type="s" direction="in" name="input"/> <arg type="u" direction="out" name="length"/> </method> <signal name="TestSignal"> <arg name="type" type="s"/> <arg name="value" type="b"/> </signal> <property name="ReadOnlyProperty" type="s" access="read"/> <property name="ReadWriteProperty" type="b" access="readwrite"/> </interface> </node>`; // An example of the service-side implementation of the above interface. class Service { constructor() { this.dbus = Gio.DBusExportedObject.wrapJSObject(ifaceXml, this); } // Properties get ReadOnlyProperty() { return 'a string'; } get ReadWriteProperty() { if (this._readWriteProperty === undefined) return false; return this._readWriteProperty; } set ReadWriteProperty(value) { if (this.ReadWriteProperty !== value) { this._readWriteProperty = value; // Emitting property changes over DBus this.dbus.emit_property_changed( 'ReadWriteProperty', new GLib.Variant('b', value) ); } } // Methods SimpleMethod() { print('SimpleMethod() invoked'); } ComplexMethod(input) { print(`ComplexMethod() invoked with "${input}"`); return input.length; } // Signals emitTestSignal() { this.dbus.emit_signal( 'TestSignal', new GLib.Variant('(sb)', ['string', false]) ); } } // Once you've created an instance of your service, you will want to own a name // on the bus so clients can connect to it. let serviceObj = new Service(); let serviceSignalId = 0; function onBusAcquired(connection, _name) { // At this point you have acquired a connection to the bus, and you should // export your interfaces now. serviceObj.dbus.export(connection, '/org/gnome/gjs/Test'); } function onNameAcquired(_connection, _name) { // Clients will typically start connecting and using your interface now. // Emit the TestSignal every few seconds serviceSignalId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 3, () => { serviceObj.emitTestSignal(); return GLib.SOURCE_CONTINUE; }); } function onNameLost(_connection, _name) { // Clients will know not to call methods on your interface now. Usually this // callback will only be invoked if you try to own a name on DBus that // already has an owner. // Stop emitting the test signal if (serviceSignalId > 0) { GLib.Source.remove(serviceSignalId); serviceSignalId = 0; } } let ownerId = Gio.bus_own_name( Gio.BusType.SESSION, 'org.gnome.gjs.Test', Gio.BusNameOwnerFlags.NONE, onBusAcquired, onNameAcquired, onNameLost ); // Start an event loop let loop = GLib.MainLoop.new(null, false); loop.run(); // Unowning names works just like disconnecting, but note that `onNameLost()` // will not be invoked in this case. Gio.bus_unown_name(ownerId); if (serviceSignalId > 0) { GLib.Source.remove(serviceSignalId); serviceSignalId = 0; }
Close