Ganteng Doang Upload Shell Gak Bisa


Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ usr/ bin/

//usr/bin/repo-rss

#!/usr/bin/python

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# seth vidal 2005 (c) etc etc

import yum
import yum.Errors
from yum.misc import getCacheDir, to_unicode
from yum.comps import Comps, CompsException
from yum.Errors import RepoMDError
import sys
import os
import libxml2
import time
from optparse import OptionParser

class YumQuiet(yum.YumBase):
    def __init__(self):
        yum.YumBase.__init__(self)
    
    def getRecent(self, days=1):
        """return most recent packages from sack"""

        recent = []
        now = time.time()
        recentlimit = now-(days*86400)
        ftimehash = {}
        if self.conf.showdupesfromrepos:
            avail = self.pkgSack.returnPackages()
        else:
            avail = self.pkgSack.returnNewestByNameArch()
        
        for po in avail:
            ftime = int(po.returnSimple('filetime'))
            if ftime > recentlimit:
                if ftime not in ftimehash:
                    ftimehash[ftime] = [po]
                else:
                    ftimehash[ftime].append(po)

        for sometime in ftimehash.keys():
            for po in ftimehash[sometime]:
                recent.append(po)
        
        return recent

class RepoRSS:
    def __init__(self, fn='repo-rss.xml'):
        self.description = 'Repository RSS'
        self.link = 'http://yum.baseurl.org'
        self.title = 'Recent Packages'
        self.doFile(fn)
        self.doDoc()
        
    def doFile(self, fn):
        if fn[0] != '/':
            cwd = os.getcwd()
            self.fn = os.path.join(cwd, fn)
        else:
            self.fn = fn
        try:
            self.fo = open(self.fn, 'w')
        except IOError, e:
            print >> sys.stderr, "Error opening file %s: %s" % (self.fn, e)
            sys.exit(1)

    def doDoc(self):
        """sets up our doc and rssnode attribute initially, rssnode will be
           redfined as we move along"""
        self.doc = libxml2.newDoc('1.0')
        self.xmlescape = self.doc.encodeEntitiesReentrant
        rss = self.doc.newChild(None, 'rss', None)
        rss.setProp('version', '2.0')
        self.rssnode = rss.newChild(None, 'channel', None)

    def startRSS(self):
        """return string representation of rss preamble"""
    
        rfc822_format = "%a, %d %b %Y %X GMT"
        now = time.strftime(rfc822_format, time.gmtime())
        rssheader = """<?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0">
      <channel>
        <title>%s</title>
        <link>%s</link>
        <description>%s</description>
        <pubDate>%s</pubDate>
        <generator>Yum</generator>
        """ % (self.title, self.link, self.description, now)
        
        self.fo.write(rssheader)
    
    
    def doPkg(self, pkg, url):
        item = self.rsspkg(pkg, url)
        self.fo.write(item.serialize("utf-8", 1))
        item.unlinkNode()
        item.freeNode()
        del item
    
        
    def rsspkg(self, pkg, url):
        """takes a pkg object and repourl for the pkg object"""
        
        rfc822_format = "%a, %d %b %Y %X GMT"
        clog_format = "%a, %d %b %Y GMT"
        escape = self.xmlescape
        
        item = self.rssnode.newChild(None, 'item', None)
        title = escape(str(pkg))
        item.newChild(None, 'title', title)
        date = time.gmtime(float(pkg.returnSimple('buildtime')))
        item.newChild(None, 'pubDate', time.strftime(rfc822_format, date))
        item.newChild(None, 'guid', pkg.returnSimple('id')).setProp("isPermaLink", "false")        
        link = url + '/' + pkg.returnSimple('relativepath')
        item.newChild(None, 'link', escape(link))
    
        # build up changelog
        changelog = ''
        cnt = 0
        if (pkg.changelog != None):
            where = pkg.changelog
        else:
            where = pkg.returnChangelog()
        for e in where:
            cnt += 1
            if cnt > 3: 
                changelog += '...'
                break
            (date, author, desc) = e
            date = time.strftime(clog_format, time.gmtime(float(date)))
            changelog += '%s - %s\n%s\n\n' % (date, author, desc)
        description = '<p><strong>%s</strong> - %s</p>\n\n' % (escape(pkg.name), 
                                            escape(pkg.returnSimple('summary')))
        description += '<p>%s</p>\n\n<p><strong>Change Log:</strong></p>\n\n' % escape(to_unicode(pkg.returnSimple('description')).encode('utf-8').replace("\n", "<br />\n"))
        description += escape('<pre>%s</pre>' % escape(to_unicode(changelog).encode('utf-8')))
        item.newChild(None, 'description', description)
        
        return item
        

    def closeRSS(self):
        """end the rss output"""
        
        end="\n  </channel>\n</rss>\n"
        self.fo.write(end)
        self.fo.close()
        del self.fo
        self.doc.freeDoc()
        del self.doc
    
    
def makeFeed(filename, title, link, description, recent, my):
    rssobj = RepoRSS(fn=filename)
    rssobj.title = title
    rssobj.link = link
    rssobj.description = description
    rssobj.startRSS()
    # take recent updates only and dump to an rss compat output
    if len(recent) > 0:
        for pkg in recent:
            repo = my.repos.getRepo(pkg.repoid)
            url = repo.urls[0]
            rssobj.doPkg(pkg, url)
    rssobj.closeRSS()


def main(options, args):
    days = options.days
    repoids = args
    my = YumQuiet()
    if options.config:
        my.doConfigSetup(init_plugins=False, fn=options.config)
    else:
        my.doConfigSetup(init_plugins=False)

    if os.geteuid() != 0 or options.tempcache:
        cachedir = getCacheDir()
        if cachedir is None:
            print "Error: Could not make cachedir, exiting"
            sys.exit(50)
        my.repos.setCacheDir(cachedir)

    if len(repoids) > 0:
        for repo in my.repos.repos.values():
            if repo.id not in repoids:
                repo.disable()
            else:
                repo.enable()

    try:
        my._getRepos()
    except yum.Errors.RepoError, e:
        print >> sys.stderr, '%s' % e
        print 'Cannot continue'
        sys.exit(1)
    print 'Reading in repository metadata - please wait....'
    if len(options.arches):
        my._getSacks(archlist=options.arches)
    else:
        my._getSacks()

    for repo in my.repos.listEnabled():
            
        try:
            my.repos.populateSack(which=[repo.id], mdtype='otherdata')
        except yum.Errors.RepoError, e:
            print >> sys.stderr, 'otherdata not available for repo: %s' % repo
            print >> sys.stderr, 'run as root to get changelog data'
            sys.exit(1)
    
    recent = my.getRecent(days=days)
    recent.sort(key=lambda pkg: pkg.returnSimple('filetime'))
    recent.reverse()
    if options.groups:
        comps = Comps()
        for repo in my.repos.listEnabled():
            try: 
                groupsfn = repo.getGroups()
            except RepoMDError: # no comps.xml file
                groupsfn = None
            if not groupsfn:
                continue
            try:
                comps.add(groupsfn)
            except (AttributeError, CompsException):
                print 'Error parsing comps file %s !' % groupsfn
                print 'Multiple feed generation impossible.'
                sys.exit(1)
        for group in comps.groups:
            grouppkgs = group.optional_packages.keys() + group.default_packages.keys() + group.conditional_packages.keys()
            title = "%s - %s" % (options.title, group.name)
            description = "%s. %s" % (options.description, group.name)
            filename = "%s.xml" % group.groupid
            packages = [ pkg for pkg in recent if pkg.name in grouppkgs ]
            makeFeed(filename, title, options.link, description, packages, my)
    # Always make a full feed
    makeFeed(options.filename, options.title, options.link, options.description, recent, my)
    


if __name__ == "__main__":
    usage = "repo-rss.py [options] repoid1 repoid2"
    
    parser = OptionParser(usage=usage)
    parser.add_option("-f", action="store", type="string", dest="filename",
                      default='repo-rss.xml', help="filename to write rss to: %default")
    parser.add_option("-l", action="store", type='string', dest='link',
                      default='http://yum.baseurl.org',
                      help="url for rss feed link: %default")
    parser.add_option("-t", action='store', type='string', dest='title',
                      default="RSS Repository - Recent Packages",
                      help='Title for Rss feed: %default')
    parser.add_option("-d", action='store', type='string', dest='description',
                      default="Most recent packages in Repositories",
                      help='description of feed: %default')
    parser.add_option('-r', action='store', type='int', dest='days', default=3,
                      help='most recent (in days): %default')
    parser.add_option("--tempcache", default=False, action="store_true",
                      help="Use a temp dir for storing/accessing yum-cache")
    parser.add_option("-g", action='store_true', dest='groups', default=False,
                      help="Generate one feed per package group")
    parser.add_option("-a", action='append', dest='arches', default=[],
                      help="arches to use - can be listed more than once")
    parser.add_option("-c", action='store', dest='config', default=None,
                      help="config file")
    (options, args) = parser.parse_args()

    main(options, args)

			
			


Thanks For 0xGh05T - DSRF14 - Mr.Dan07 - Leri01 - FxshX7 - AlkaExploiter - xLoveSyndrome'z - Acep Gans'z

JMDS TRACK – Just Another Diagnostics Lab Site

Home

JMDS TRACK Cameroon

Boost the productivity of your mobile ressources


Make An Appointment


Fleet management

  1. Reduce the operting cost and the unavailability of your vehicles
  2. reduce the fuel consumption of your fleet
  3. Improve the driving dehavior and safety of your drivers
  4. optimize the utilization rate of your equipment 
  5. protect your vehicle against theft
  6. Improve the quality of your customer service


Find out more

Assets management

  1. Track the roaming of your equipment
  2. Optimise the management of your assets on site and during transport
  3. Secure the transport of your goods
  4. Make your team responsible for preventing the loss of tools, equipment
  5. Take a real-time inventory of your equipment on site
  6. Easily find your mobile objects or equipment



Find out more



Find out more

Antitheft solutions

  1. Secure your vehicles and machinery and increase your chances of recovering them in the event of theft
  2. Protect your assets and reduce the costs associated with their loss
  3. Combine immobiliser and driver identification and limit the risk of theft
  4. Identify fuel theft and reduce costs
  5. Protect your goods and take no more risks
  6. Be alerted to abnormal events

Our Location

 Douala BP cité 

     and

Yaoundé Total Essos


Make An Appointment


Get Directions

682230363/ 677481892

What makes us different from others

  • young and dynamic team
  • call center 24/24 7/7
  • roaming throughout Africa
  • team of developers who can develop customer-specific solutions
  • diversity of services
  • reactive and prompt after-sales service when soliciting a customer or a malfunction
  • Free Maintenance and installation in the cities of Douala and Yaounde

https://youtu.be/xI1cz_Jh2x8

15+
years of experience in GPS system development, production and deployment.

15 Collaborators

More than 15 employees dedicated to the research and development of new applications and to customer care

5 000 Vehicles and mobile assets

5 000 vehicles and mobile assets under management, in Africa

Our Partners










Latest Case Studies

Our current projects 

5/5
Bon SAV , SATISFAIT DU TRAITEMENT DES REQUETES

M DIPITA CHRISTIAN
Logistic Safety Manager Road Safety Manager
5/5
La réactivité de JMDS est excellente
Nous restons satisfait dans l’ensemble des prestations relatives a la couverture de notre parc automobile

Hervé Frédéric NDENGUE
Chef Service Adjoint de la Sécurité Générale (CNPS)
5/5
L’APPLICATION EMIXIS est convivial A L’utilisation
BEIG-3 SARL
DIRECTOR GENERAL
5/5
Nevertheless I am delighted with the service
MR. BISSE BENJAMIN
CUSTOMER

Subsribe To Our Newsletter

Stay in touch with us to get latest news and special offers.



Address JMDS TRACK

Douala bp cité



and

YAOUNDE Total Essos

Call Us

+237682230363



Email Us


info@jmdstrack.cm