Showing posts with label manager. Show all posts
Showing posts with label manager. Show all posts

Sunday, June 11, 2017

Dbus Tutorial Fun with Network Manager

Dbus Tutorial Fun with Network Manager


Introduction
Introspection: figuring out the rules 
Fun with Network Manager
Create a service 
Gobject Introspection


Lets figure out how to use  dbus to get detailed information out of Network Manager (NM), and then to plug our own information back into NM.

Example #1: This script determines if a specific network is the active connection. This is handy for, say, mapping network printers or networked drives, or setting the time, or automating backups, or lots of other stuff.

#!/bin/sh
# What network am I on?

# Get the Active Connection path
# Result should be like: /org/freedesktop/NetworkManager/ActiveConnection/187
active_connection_path=$( dbus-send --system --print-reply
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager"
string:"ActiveConnections"
| grep ActiveConnection/ | cut -d" -f2 )

# Get the Access Point path
# Result should be like: /org/freedesktop/NetworkManager/AccessPoint/194
access_point_path=$( dbus-send --system --print-reply
--dest=org.freedesktop.NetworkManager
"$active_connection_path"
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager.Connection.Active"
string:"SpecificObject"
| grep variant | cut -d" -f2 )

# Get the Access Point ESSID
# Result should be something like "NETGEAR"
essid=$( dbus-send --system --print-reply
--dest=org.freedesktop.NetworkManager
"$access_point_path"
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager.AccessPoint"
string:"Ssid"
| grep variant | cut -d" -f2 )



# If we are on the HOME network
if [ "$essid"=="MyHomeNet" ]; then
# Do network-specific changes here

elif [ "$essid"=="WorkCorporateNet" ]
# Do network-specific changes here

else
# Do changes for unrecognized network or no network at all here

fi
exit 0


Example #2: Disable networking

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.DBus.Properties.Set
string:"org.freedesktop.NetworkManager"
string:"NetworkingEnabled"
variant:boolean:false


Example #3: Enable networking. Its exactly the same as the previous example, except for the last line.

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.DBus.Properties.Set
string:"org.freedesktop.NetworkManager"
string:"NetworkingEnabled"
variant:boolean:true


Example #4: Check networking status

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager"
string:"NetworkingEnabled"

method return sender=:1.4 -> dest=:1.325 reply_serial=2
variant boolean true


Example #5: Disable Wireless

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.DBus.Properties.Set
string:"org.freedesktop.NetworkManager"
string:"WirelessEnabled"
variant:boolean:false


Example #6: Enable Wireless

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.DBus.Properties.Set
string:"org.freedesktop.NetworkManager"
string:"WirelessEnabled"
variant:boolean:true


Example #7: Check Wireless Status

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager"
string:"WirelessEnabled"

method return sender=:1.4 -> dest=:1.326 reply_serial=2
variant boolean true


Example #8:



Example #9: List all active network connections

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager"
string:"ActiveConnections"

method return sender=:1.4 -> dest=:1.328 reply_serial=2
variant array [
object path "/org/freedesktop/NetworkManager/ActiveConnection/18"
]


Example #10: Which interface is the active connection using?

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/ActiveConnection/18
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager.Connection.Active"
string:"Devices"

method return sender=:1.4 -> dest=:1.331 reply_serial=2
variant array [
object path "/org/freedesktop/NetworkManager/Devices/0"

$ dbus-send --system --print-reply
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/Devices/0
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager.Device"
string:"Interface"

method return sender=:1.4 -> dest=:1.332 reply_serial=2
variant string "wlan0"


Example #11: Get the current wireless access point

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/ActiveConnection/18
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager.Connection.Active"
string:"SpecificObject"

method return sender=:1.4 -> dest=:1.334 reply_serial=2
variant object path "/org/freedesktop/NetworkManager/AccessPoint/209"


Example #12: Get the list of all visible wireless access points

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/Devices/0
org.freedesktop.NetworkManager.Device.Wireless.GetAccessPoints

method return sender=:1.4 -> dest=:1.333 reply_serial=2
array [
object path "/org/freedesktop/NetworkManager/AccessPoint/209"
object path "/org/freedesktop/NetworkManager/AccessPoint/208"
object path "/org/freedesktop/NetworkManager/AccessPoint/207"
object path "/org/freedesktop/NetworkManager/AccessPoint/206"
]


Example #13: Read the SSID of the active wireless access point

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/AccessPoint/209
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager.AccessPoint"
string:"Ssid"

method return sender=:1.4 -> dest=:1.335 reply_serial=2
variant array of bytes "NETGEAR"


Example #14: Read the signal strength of the active wireless point

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/AccessPoint/209
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager.AccessPoint"
string:"Strength"

method return sender=:1.4 -> dest=:1.340 reply_serial=2
variant byte 54
# 54 in byte (hexadecimal) = 84 in decimal. Strength = 84%


Example #15: Read the stored NM connection that is currently active

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/ActiveConnection/18
org.freedesktop.DBus.Properties.Get
string:"org.freedesktop.NetworkManager.Connection.Active"
string:"Connection"

method return sender=:1.4 -> dest=:1.379 reply_serial=2
variant object path "/org/freedesktop/NetworkManager/Settings/10"


Example #16: Disconnect from the current network connection (auto-reconnect)

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager
org.freedesktop.NetworkManager.DeactivateConnection
objpath:"/org/freedesktop/NetworkManager/ActiveConnection/18"

method return sender=:1.4 -> dest=:1.370 reply_serial=2


Example #17: Disconnect from the current network connection and stay disconnected

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/Devices/0
org.freedesktop.NetworkManager.Device.Disconnect

method return sender=:1.4 -> dest=:1.354 reply_serial=2


Example #18: Connect to a specific wireless network

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
org/freedesktop/NetworkManager
org.freedesktop.NetworkManager.ActivateConnection
objpath:"/org/freedesktop/NetworkManager/Settings/10"
objpath:"/org/freedesktop/NetworkManager/Devices/0"
objpath:"/org/freedesktop/NetworkManager/AccessPoint/209"

method return sender=:1.4 -> dest=:1.382 reply_serial=2
object path "/org/freedesktop/NetworkManager/ActiveConnection/20"


Example #19: Dump all information about an access point

$ dbus-send --system --print-reply 
--dest=org.freedesktop.NetworkManager
/org/freedesktop/NetworkManager/Settings/10
org.freedesktop.NetworkManager.Settings.Connection.GetSettings

method return sender=:1.4 -> dest=:1.386 reply_serial=2
array [## EDITED - its really long]


Read more »

Sunday, April 5, 2015

Real Football Manager Edition Java Games Download For Mobile

Take your team in Real football manager edition to the victory. Choose a club among different leagues and teams. Make a training plan and an exclusive game tactics which will take you to the victory.To download Real football manager edition free java game, we recommend you to select your phone model, and then our system will choose the most suitable game files. Downloading is very simple: select the desired file and click "Java Real football manager edition - free download...!

Game features:



  • Many leagues and teams
  • Excellent graphics
  • Interesting playing process

 Real Football Manager Edition Java Games Screen Shot:

Real football manager edition


To download Real football manager edition free java game, we recommend you to select your phone model, and then our system will choose the most suitable game files. Downloading is very simple: select the desired file and click "Java Real football manager edition - free download", then select one of the ways you want to get the file. Just a few easy steps and will enjoy playing new game at your phone!
                                                                       




                                                               Click Here Download Now

                                                                                             
http://adf.ly/sLttY
 
Read more »

Thursday, March 19, 2015

Lowongan Accounting Manager Sariwangi GroupLowongan Accounting Manager Sariwangi Group

(lowongan bank - lowongan BUMN - lowongan kerja terbaru - lowongan cpns - karir)
Sariwangi Group as one of the well established and fast growing tea manufacturing companies in Indonesia specializing in Tea Production, is looking for a qualified candidate to fill in the position of :

Accounting Manager


It is in our best interest to put the right people in the right place, based on their passion and competency.

To be successful in this position, you would be expected to have the following qualifications:

    * Having at least 3-5 years of working experience in Accounting & Finance Division
    * First Degree majoring in Accounting
    * Understand cash flow & budgeting, and also can make Financial Reports
    * Good communication skill
    * Fluently in English
    * Has sense of managing skills

Only short list candidates will be notified. Please indicate the applied position at the subject of your email, and send your application, CV, academic transcript and recent photograph no later that three weeks after the publication of this advertisement to :

recruitment@sariwangi.co.id and cc to sariwangiaea@yahoo.com

( orhiba.com )
Read more »

Sunday, March 15, 2015

Internet Download Manager 2015 Full Version Free download

Internet Download Manager 2015 Full Version Free download

Internet Download Manager 2015 latest Version for free download available. IDM is very famous downloading software for quick file download and IDM gives you 10 time faster download speed so you can download every thing what you want even you can download more then then files at the same time and you can also manage and control download speed individually. This software one of the best IDM for windows based PC and compatible with all internet browsers Such as:-
  1. Google Chrome
  2. Mozilla Firefox
  3. Apple Safari
  4. Internet Explorer
  5. Opera Browser
  6. Water-fox 64bit Browser
IDM is only Download Manager which support every extension of file for download. for example
  • Multi Media Files> MP3,MP4,3GP, FLV, VOB, MOV, MPEG, AVI
  • Document Files > DOC, PDF, EXE file
  • Zip Files >ISO, RAR, ZIP, BIN
IDM can be install on Windows XP, Windows 7 and other operating systems. Internet download manager can also download audio and video files from every live streaming website and from social media pages. with out download manager you can not download these type of video file this feature called file grabbing.

Computer Hardware Requirement:-

Microsoft Apple MAC Type: Windows XP Windows 7 Windows 8
Desktop Laptop: Pentium 4 Dual Core core 2 Duo Core i3
Random Access Memory: 1 Gb
Hard Drive SSD Space: 15Gb
Graphics Card: Nvidia AMD Intel HD Graphics for Gaming.
Network Connection: High Speed Net for Download or Online Game Play
DVD Player HD DVD BluRay Disk Player

Application Information:-

File Size:6.42 MB
App Version:6.21
Licence Type:shareware
OS Platform:Windows
Developed By:Tonec
Internet Download Manager 2015 Full Version Free download
Read more »