403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/UpdateManager/Core/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/UpdateManager/Core/__pycache__/utils.cpython-314.pyc
+
�ڞivE���^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIHt^RI	H	t
^RI	Ht^RIH
t
^RIHtHtHt^RIHt^RIHtHtHtHtHt^RIt^RIt]P8!4!R	R
]4t!RR4tR
t Rt!R.Rlt"Rt#R/Rlt$Rt%Rt&Rt'Rt(Rt)Rt*!RR]4t+R.Rlt,R.Rlt-Rt.Rt/Rt0Rt1R.R lt2R!t3R.R"lt4R.R#lt5R$t6R%t7R&t8R't9R(t:R)t;R*t<]=R+8Xd
]6!RR,R-4R#R#)0�N)�copy)�gettext)�ngettext)�ceil)�S_IMODE�S_IXUSR�ST_MODE)�urlsplit)�ProxyHandler�Request�build_opener�install_opener�urlopenc�:a�]tRt^4toRtRRltRtRtRtVt	R#)�
ExecutionTimez�
Helper that can be used in with statements to have a simple
measure of the timing of a particular block of code, e.g.
with ExecutionTime("db flush"):
    db.flush()
c��WnR#�N)�info)�selfrs&&�:/usr/lib/python3/dist-packages/UpdateManager/Core/utils.py�__init__�ExecutionTime.__init__<s���	�c�:�\P!4VnR#r)�time�now�rs&r�	__enter__�ExecutionTime.__enter__?s���9�9�;��rc��\VP:R\P!4VP,
:24R#)z: N)�printrrr)r�type�value�stacks&&&&r�__exit__�ExecutionTime.__exit__Bs"��
�$�)�)�T�Y�Y�[�4�8�8�%;�<�=r)rrN)�)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__rrr%�__static_attributes__�__classdictcell__��
__classdict__s@rrr4s�������>�>rrc�2�]tRt^Ft^t^t^t^t^t^t	^t
RtR#)�SoftwarePropertiesPage�N)r(r)r*r+�ubuntu_software�other_software�updates�authentication�additional_drivers�developer_options�
ubuntu_pror-r3rrr2r2Fs'���O��N��G��N������Jrr2c�L�\V4p\VP4pVP'd,VPP	VPR4VnVP
'd,VPP	VP
R4Vn\
V4#)zhidden-uzhidden-p)rr
�uri�username�replace�password�str)�entry�tmp�	url_partss&  r�)get_string_with_no_auth_from_source_entryrDPsr��
�u�+�C�����!�I������'�'�/�/�)�"4�"4�j�A��������'�'�/�/�)�"4�"4�j�A����s�8�Orc��Rp^RIpVP4pVPR4pV# \d\P
!R4T#i;i)z)return True if Unity is currently runningFNzcom.canonical.Unityz&could not check for Unity dbus service)�dbus�
SessionBus�name_has_owner�	Exception�logging�	exception)�
unity_runningrF�buss   r�is_unity_runningrNZs]���M�D���o�o����*�*�+@�A�
�����D����B�C���D�s�%+�!A�Ac��V'g\P!4pV^8�d�RV,p\V4;_uu_4pVP4pRRR4XP	R4^,PR4^,pWP8XdR#\
VPR4^,P4^,4pK�R# +'giL�;i)rz
/proc/%s/statN�(�)TF)�os�getpid�open�read�	partition�
rpartition�int�split)�processname�pid�	stat_file�stat_f�stat�commands&&    r�is_child_of_process_namer`gs�����i�i�k��

��'�#�c�)�	�
�)�_�_���;�;�=�D���.�.��%�a�(�3�3�C�8��;���!���$�/�/�#�&�q�)�/�/�1�!�4�5����_�s�C
�
C	c���\PPR4'd&\PPR4'gR#\P!R4\P!R48g#)z&returns True if we are inside a chrootz/procz/proc/1T�/z/proc/1/root)rR�path�existsr^r3rr�
inside_chrootrewsH���7�7�>�>�'�"�"�"�'�'�.�.��*C�*C��
�7�7�3�<�2�7�7�>�2�2�2rc���RpVP4FXp\V4VPR4,
\V4,V8�dVRV,,
pW4R,,
pKZ	V#)z�helpers inspired after textwrap - unfortunately
we can not use textwrap directly because it break
packagenames with "-" in them into new lines
r'�
� )rY�len�rfind)�t�width�subsequent_indent�out�ss&&&  r�wraprp�s]��

�C�
�W�W�Y����H�s�y�y���&�#�a�&�0�5�8��4�+�+�+�C��3�w�����Jrc�t�RpVPR4pVFp\V3/VBpW R,,
pK 	V#)r'rg)rYrp)ro�kwargs�msg�paras�pars&,   r�twraprv�s?��
�C�
�G�G�D�M�E����������4�x�����Jrc�l�.p\PPR4'g.#\P!R.\P
RR7pVP
4^,PR4pV^VF3pV'gK
VPVP4^,4K5	V#)z;return list of loaded modules (or [] if lsmod is not found)z/sbin/lsmodT��stdout�universal_newlinesrg)	rRrcrd�
subprocess�Popen�PIPE�communicaterY�append)�modules�p�lines�lines    r�lsmodr��s����G�
�7�7�>�>�-�(�(��	����	��
���D�	�A�
�M�M�O�A��$�$�T�*�E�
�a�����4��N�N�4�:�:�<��?�+���Nrc��\PPV4'gR#\\P!V4\
,4pV\,\8Xg$\P!W\,4R#R#)zAcheck if a given binary has the executable bit and if not, add itN)rRrcrdrr^r	r�chmod)rc�modes& r�check_and_fix_xbitr��sP��
�7�7�>�>�$�����2�7�7�4�=��)�*�D�
�G�^��'�
����g�~�&�
(rc��RR/pR\P9dR#\PR,P4pVR,V9dWR,,#RV9dWVPR4^,PR4^,pRV9dVPR4^,pVR,#VR,R,#)	z8helper to get the country mirror from the current locale�cr'�LANG:N�N�_�.�@:N�N)rR�environ�lowerrY)�lang_mirror�lang�countrys   r�country_mirrorr��s�����)�K�
�R�Z�Z���
�:�:�f��#�#�%�D��B�x�;����8�$�$�
�d�{��*�*�S�/�!�$�*�*�3�/��2���'�>��m�m�C�(��+�G���}���B�x�#�~�rc���\PPR4pV'd \P!RV,4V#\
P!4pVPRR4#)z0return the codename of the current runing distro�META_RELEASE_FAKE_CODENAMEzQusing fake release name '%s' (because of META_RELEASE_FAKE_CODENAME environment) �VERSION_CODENAME�unknown distribution�rRr��getrJ�warning�platform�freedesktop_os_release)�dist�
os_releases  r�get_distr��s[���:�:�>�>�6�7�D�����
7�9=�
>�	
����0�0�2�J��>�>�,�.D�E�Erc���\PPR4pV'd \P!RV,4V#\
P!4pVPRR4#)z0return the version of the current running distro�META_RELEASE_FAKE_VERSIONzSusing fake release version '%s' (because of META_RELEASE_FAKE_VERSION environment) �
VERSION_IDr�r�)�descr�s  r�get_dist_versionr��sZ���:�:�>�>�5�6�D�����
6�8<�
=�	
����0�0�2�J��>�>�,�(>�?�?rc�&a�]tRt^�toRtRtVtR#)�HeadRequestc��R#)�HEADr3rs&r�
get_method�HeadRequest.get_method�s��rr3N)r(r)r*r+r�r-r.r/s@rr�r��s�����rr�c
�<�V'gRV!RV,4\V4wr#rEpV!RV:RV:RV:RV:RV:R24VR9d;\\V44pVP4VP^�8XdR	#R
#VR
8Xd�^RIp	V	PV4p
V
P4V
P\PPV44V
P\PPV44pV
P4V'dV!RV,4V^8wdR	#R
#R
# \
dpT!RT,4Rp?R
#Rp?ii;i \
d#pT'dT!RT,4Rp?R
#Rp?ii;i)z�
helper that checks if the given uri exists and is downloadable
(supports optional debug_func function handler to support
 e.g. logging)

Supports http (via HEAD) and ftp (via size request)
c��R#)Tr3)�xs&r�<lambda>�"url_downloadable.<locals>.<lambda>�s��$rzurl_downloadable: %szs='z' n='z' p='z' q='z' f='�'TFzerror from httplib: '%s'N�ftpzftplib.size() returned: %szerror from ftplib: '%s')�http�https)r
rr��close�coderI�ftplib�FTP�login�cwdrRrc�dirname�size�basename�quit)r<�
debug_func�scheme�netlocrc�querry�fragment�	http_file�er��fr�s&&          r�url_downloadabler��sO�����%��+�,�/7��}�,�V�T�8���6�4���	3���"�"�	���C� 0�1�I��O�O���~�~��$���
�5���
	��
�
�6�"�A�
�G�G�I�
�E�E�"�'�'�/�/�$�'�(��6�6�"�'�'�*�*�4�0�1�D�
�F�F�H���7�$�>�?��q�y�����)�	��1�A�5�6���	�� �	���4�q�8�9���	�s7�5E�BE.�)E.�E+�E&�&E+�.F�9F�Fc�N�Rp/p\PPR4R8wd$\PPR4VR&M�\PPV4'd�\P!4p\P!W14VPRR4pV'dJVPR4p\VPR44pV'dV'dR	V:R
V:R2VR&\PPR4R8wd$\PPR4VR
&MRV9d
VR,VR
&V'd�VP4FEp\P!RV4'dK"\RV,\P R7R#	\#V4p\%V4p	\'V	4RV9d\P(!RVR,4R
V9d\P(!RVR
,4V#)z�init proxy settings

* use apt.conf http proxy if present,
* otherwise look into synaptics config file,
* otherwise the default behavior will use http_proxy environment
  if present
z/root/.synaptic/synaptic.confzAcquire::http::Proxyr'r�zSynaptic::useProxyFzSynaptic::httpProxyzSynaptic::httpProxyPortzhttp://�:rbzAcquire::https::Proxyr�zhttps?://\w+zproxy '%s' looks invalid)�fileN�
http_proxy�https_proxy)�apt_pkg�config�findrRrcrd�
Configuration�read_config_file�find_br@�find_i�values�re�matchr!�sys�stderrrr
r�putenv)
�	gsettings�SYNAPTIC_CONF_FILE�proxies�cnf�	use_proxy�
proxy_host�
proxy_port�proxy�
proxy_support�openers
&         r�
init_proxyr�s���9���G��~�~���1�2�b�8�!�.�.�-�-�.D�E����	�����*�	+�	+��#�#�%��� � ��9��J�J�3�U�;�	�����"7�8�J��S�Z�Z�(A�B�C�J��j�j�5?��"L�����~�~���2�3�r�9�"�>�>�.�.�/F�G����	�7�	�"�6�?������^�^�%�E��8�8�O�U�3�3��0�5�8�s�z�z�J��&�%�W�-�
��m�,���v���W���I�I�l�G�F�O�4��g���I�I�m�W�W�%5�6��Nrc���^RIpVPVPP4pVPRR4pVP	VR4pVPRR4# TPPdUpRpTPT8wdhTPRR4pTP	TR4pTPRR	4uRp?#Rp?ii;i \dR
#i;i)z�
Check via dbus if the system is running on battery.
This function is using UPower per default, if UPower is not
available it falls-back to DeviceKit.Power.
Nzorg.freedesktop.UPowerz/org/freedesktop/UPowerzorg.freedesktop.DBus.Properties�	OnBatteryz)org.freedesktop.DBus.Error.ServiceUnknownzorg.freedesktop.DeviceKit.Powerz /org/freedesktop/DeviceKit/Power�
on_batteryF)
rF�Bus�TYPE_SYSTEM�
get_object�	Interface�Get�
exceptions�
DBusException�_dbus_error_namerI)rFrM�devobj�devr��
error_unknowns      rr�r�Es������h�h�t�x�x�+�+�,��	L��^�^�(�*C��F��.�.��)J�K�C��7�7�3�[�A�A�����,�,�		L�G�M��!�!�]�2���^�^�1�2��F��.�.��)J�K�C��7�7�<�l�K�K��		L������s;�)C�5A"�"C�=A	C�C�C�C�C�C#�"C#c�:�^RIHpHpVPVPP
4pVP
RRRRVPRR
4R^RRR4
wr4VPVP4V^,,R7pV# \dR	#i;i)zv
Send a dbus signal to logind to not suspend the system, it will be
released when the return value drops out of scope
)�Gio�GLibzorg.freedesktop.login1z/org/freedesktop/login1zorg.freedesktop.login1.Manager�Inhibitz(ssss)N)�fdF)�sleep�
UpdateManagerzUpdating System�block���)�
gi.repositoryr�r��bus_get_sync�BusType�SYSTEM�call_with_unix_fd_list_sync�Variant�UnixInputStream�	steal_fdsrI)r�r��
connection�var�fdlist�	inhibitors      r�
inhibit_sleepr
es���
�+��%�%�c�k�k�&8�&8�9�
� �<�<�$�%�,���L�L���
�
�
����%
���(�'�'�6�+;�+;�+=�c�!�f�+E�'�F�	��������s�BB�B�Bc�B�VR8XgVP4R8XdR#R#)�0�FALSEFT)�upper)r@s&r�str_to_boolr�s��
�c�z�S�Y�Y�[�G�+��rc��^RIp\P!4wrV# \dTP!R4R#i;i)rNzgedefaultlocale() failed)rJ�locale�getdefaultlocalerIrK)rJ�locale_s�encodings   r�get_langr�sA����%�6�6�8�����������4�5���s��A�Ac�L�\VR7pVPR^4^,#)z4try to guess the flavor based on the running desktop��cache�-)�get_ubuntu_flavor_packagerY)r�pkgs& r�get_ubuntu_flavorr�s$��
$�%�
0�C��9�9�S�!��Q��rc�B�^RIHpV!R4pVPRR4#)r)�DistUpgradeConfigz"/usr/share/ubuntu-release-upgrader�Distro�MetaPkgs)�#DistUpgrade.DistUpgradeConfigParserr�getlist)r�parsers  r�_load_meta_pkg_listr$�s$��F�
�C�
D�F��>�>�(�J�/�/rc�>�R.pVP\\444Vf\
P!4pVF3pW09d	W,MRpV'gKVP'gK1Vu#	R# \dp\	RT4Rp?LpRp?ii;i)z@try to guess the flavor metapackage based on the running desktopzubuntu-desktopz%Could not load list of meta packages:N)�extend�sortedr$rIr!�apt�Cache�is_installed)r�	meta_pkgsr��meta_pkg�	cache_pkgs&    rrr�s���
"�"�I�:����� 3� 5�6�7�
�}��	�	�����'/�'8�E�O�d�	��9��/�/�/��O�����:�
�5�q�9�9��:�s�"A;�;B�B�Bc�&�\VR7pRR/pW9d	W!,#VPR4'd#\VPR^4^,4#VPR4'd#\VPR^4^,4#R#)z9try to guess the flavor name based on the running desktoprzubuntustudio-desktopz
Ubuntu Studioz-desktopz-netbook�Ubuntu)r�endswith�capitalize_first_word�rsplit)rr�lookups&  r�get_ubuntu_flavor_namer4�sz��
#�%�
0�C�$�o�
6�F�
�}��{��	���j�	!�	!�$�S�Z�Z�
�A�%>�q�%A�B�B�	���j�	!�	!�$�S�Z�Z�
�A�%>�q�%A�B�B�rc��^RIpVPRR4^RIHpHpVPVVPPVPPVPPR7pVPRV:RV:24VP4VP4PVP P"4VP%R4VP'4VP)4R	#)
rN�Gtkz3.0)�Gdkr6)�parent�flagsr"�buttonsz<big><b>z</b></big>

r'F)�gi�require_versionr�r7r6�
MessageDialog�DialogFlags�MODAL�MessageType�ERROR�ButtonsType�CLOSE�
set_markup�realize�
get_window�
set_functions�
WMFunction�MOVE�	set_title�run�destroy)r8�summary�messager;r7r6�ds&&&    r�errorrP�s���
����u�e�$�&������o�o�#�#�
�_�_�
"�
"����%�%�		�	�A��L�L��'�B�C��I�I�K��L�L�N� � ����!4�!4�5��K�K��O��E�E�G��I�I�K�rc���VR8d;\\V\R4,44p\RRV4RV/,#\P
!\
R4VR,R,4#)z?
Convert a given size in bytes to a nicer better readable unit
i�z
%(size).0f kBr�z%.1f MBg@�@i@B)rXr�floatrr�
format_stringr�)�bytes�
size_in_kbs& r�
humanize_sizerV�si��

�{����e�e�D�k�1�2�3�
����*�E��J�I
�
�	
�
�#�#�A�i�L�%�&�.�6�2I�J�Jrc�@�\PPR4#)zAPT::Architecture)r�r�r�r3rr�get_archrX�s���>�>���2�3�3rc��^p^pRp\R4;_uu_4pVP4FxpVP4pV'gKVP4pWb,pWs8wdK=Wa,PR4^,p\	V^4p	W�8XgKoRRR4R#	RRR4R# +'giR#;i)z>check if the current system is listening on the given tcp port�0Az
/proc/net/tcpr�NTF)rT�	readlines�striprYrX)
�port�INDEX_LOCAL_ADDR�INDEX_STATE�STATE_LISTENING�net_tcpr�r��state�local_port_str�
local_ports
&         r�is_port_already_listeningre�s������K��O�	
�o�	�	�'��%�%�'�D��:�:�<�D����Z�Z�\�F��'�E��'��#�5�;�;�C�@��C�N��^�R�0�J��!��
�	�'�
� �!
�	� �s�A;B1�B1�%B1�1C	c�.�Rp\P!4^8wd\R4h\PP	R4'gR#\
P!RR.\
PRR7P4^,pW8XdR#R#)	z!Return True if iptables is activez�Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
z%Need root to check the iptables statez/sbin/iptablesF�iptablesz-nLTrx)	rR�getuid�OSErrorrcrdr{r|r}r~)�iptables_emptyrns  r�iptables_activerksx���N�
�y�y�{�a���=�>�>�
�7�7�>�>�*�+�+��
�
�
�	�U��J�O�O����k�m�A��C����rc���\V4^8�d`V^,P4'dCV^,P4'g&V^,P4VR,,#V#)z-this uppercases the first word's first letter:�NN)ri�isalpha�isupper�
capitalize)�strings&rr1r11sR��
�6�{�Q��6�!�9�,�,�.�.�v�a�y�7H�7H�7J�7J��a�y�#�#�%��r�
�2�2��Mrc�F�\VPRR4p\V4#)zKthis takes a package synopsis and uppercases the first word's
first letter
rMr')�getattr�	candidater1)r�names& r�get_package_labelrv8s!���3�=�=�)�R�0�D� ��&�&r�__main__�bar�bazr)�Fr')>rrJrRr�r�r{r�rrrr�r�mathrr^rrr	�urllib.parser
�urllib.requestrrr
rrr(r��init_config�objectrr2rDrNr`rerprvr�r�r�r�r�r�r�r�r�r
rrrr$rr4rPrVrXrerkr1rvr(r3rr�<module>r�s$��0��	��	��
��� ���*�*�!���������>�F�>�$���
�
� 3�
���&'��,F�@��'��
+�\)�X�@#�L�� �0��*��*K�$4��8�0�'��z��

�$��u��r

Youez - 2016 - github.com/yon3zu
LinuXploit