Code Monkey home page Code Monkey logo

scripts's Introduction

All scripts are licensed under the LGPLv2

scripts's People

Contributors

andresriancho avatar brendano avatar ferringb avatar hmg018 avatar io41 avatar lyda avatar mygod avatar pixelb avatar serixscorpio avatar sigmadee avatar six-arm avatar slaine75 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scripts's Issues

ps_mem.py proc global variable

Hi dude,

saw your post on reddit, very cool.

About the proc global variable, Instead of open(proc+sth).read() everytime, why not invent a function called read_procfs() ?

Thanks!

[gcccpuopt] AMD Athlon XP Called Athlon-4 under Arch Linux

0.99.11 script. While athlon-4 and athlon-xp may mean the same thing to GCC (?), I am wondering why not use /proc/cpuinfo to disambiguate. The rig is not a VM but straight hardware. Close ticket if not a real issue. Thanks.

$ grep "model name" /proc/cpuinfo  |  cut -d ':' -f 2
 AMD Athlon(tm) XP 3000+
$ uname --kernel-name --kernel-release
Linux 3.14.0-4-ARCH
$ gcccpuopt
Warning: Your compiler supports the -march=native option which you may prefer
-march=athlon-4 -mfpmath=sse
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.8.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /build/gcc/src/gcc-4.8-20140206/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl --disable-cloog-version-check --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 4.8.2 20140206 (prerelease) (GCC) 

Colours Not Correct

Sorry if there's a solution to this, but it seems that the colours in the HTML don't match the colours from the terminal?

ps_mem.py feature request

Hi,
ps_mem.py is great, but one feature is missing: it doesn't count memory used as tmpfs. It would be nice to see if my /tmp uses more space than it should...

ansi2html should use gawk

I am trying to run ansi2html on Debian 7.4, and awk is giving the following errors:

...
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.blink { text-decoration: blink; }

</style>
</head>

<body class="f9 b9">
<pre>
awk: line 26: illegal reference to local variable a
awk: line 26: illegal reference to local variable a
awk: line 34: illegal reference to local variable a
awk: line 37: illegal reference to local variable a
awk: line 42: illegal reference to local variable a
</pre>
</body>
</html>

I guessed this was a problem caused by Debian's awk (which is actually mawk) vs. the GNU awk, so I installed gawk and edited ansi2html.sh to use gawk intead of awk. This worked.

It would be nice if something could be done similar to the fix below that would look for gawk if it is available, and just falls back to awk if it is not.

bd2aabd21#diff-4dac4195cfea4fa023e8b43e4de75af4R90

ansi2html.sh dies on specific input.

Given the git diff file below, ansi2html (the newest version pulled straight from the repo) will generate output that stops midway thru the file.
Given that the "á" shows up in the output as a "�" I suspect that this is somehow matters.

The HTML stops on this line:
informe. Una agencia investigadora de informes de crédito deber�°

========= Input file =======================
�[1mdiff --git a/classes/screening/report/ui.class.php b/classes/screening/report/ui.class.php�[m
�[1mindex 3476082..7fbb43d 100755�[m
�[1m--- a/classes/screening/report/ui.class.php�[m
�[1m+++ b/classes/screening/report/ui.class.php�[m
�[36m@@ -319,6 +319,14 @@�[m �[mclass screening_Report_UI�[m
}�[m
break;�[m
�[m
�[32m+�[m�[32m // Decide what version of the California disclaimer to use on pur printer friendly forms.�[m
�[32m+�[m�[32m case REPORT_COMPONENT_PRINTER_FRIENDLY_HEADER:�[m
�[32m+�[m�[32m $eligReleaseV2 = Params::get('screening', 'report_component_printer_friendly_header.release.v2');�[m
�[32m+�[m�[32m if ($eligReleaseV2 <= $createTime) {�[m
�[32m+�[m�[32m $renderVersion = 2;�[m
�[32m+�[m�[32m }�[m
�[32m+�[m�[32m break;�[m
�[32m+�[m
case REPORT_COMPONENT_PHYSICAL_CRIMINAL_SEX_OFFENDER:�[m
case REPORT_COMPONENT_TALENTSHIELD_PHYSICAL_CRIMINAL_SEX_OFFENDER:�[m
case REPORT_COMPONENT_PHYSICAL_CRIMINAL_NATIONWIDE_DB:�[m
�[1mdiff --git a/core/inc/defines.inc.php b/core/inc/defines.inc.php�[m
�[1mindex a703c53..5082859 100755�[m
�[1m--- a/core/inc/defines.inc.php�[m
�[1m+++ b/core/inc/defines.inc.php�[m
�[36m@@ -195,8 +195,9 @@�[m �[mdefine ("REPORTYPE_CONSUMER_DMV", "57"); //Consumer Driving Report�[m
// NOTE::::::::::::::: PLEASE DO NOT ADD ANY REPORT TYPE WITHOUT TALKING TO NIRAJ�[m
�[m
/*******************************************************************_**/�[m
�[31m-//Defines the possible ReportComponents�[m
�[31m-//DO NOT CHANGE THE DEFINE NUMBERS ONCE THEY HAVE BEEN USED IN PRODUCTION�[m
�[32m+�[m�[32m// Defines the possible ReportComponents�[m
�[32m+�[m�[32m// DO NOT CHANGE THE DEFINE NUMBERS ONCE THEY HAVE BEEN USED IN PRODUCTION�[m
�[32m+�[m�[32m// Kept in Intelius.Packages.ReportComponents (| separated list, search for LIKE %value%)�[m
define ("REPORT_COMPONENT_NONE", "0");�[m
define ("REPORT_COMPONENT_SUMMARY", "1");�[m
define ("REPORT_COMPONENT_PROPERTY", "7");�[m
�[36m@@ -287,6 +288,7 @@�[m �[mdefine ("REPORT_COMPONENT_PHYSICAL_CRIMINAL_1_STATE", "96"); // Like 110 (natcri�[m
define ("REPORT_COMPONENT_ISERVICES_SEX_OFFENDER", "97");�[m
define ("REPORT_COMPONENT_PHYSICAL_CIVILCOUNTY", "98");�[m
define ("REPORT_COMPONENT_SOCIAL_NET_SUMMARY", "99");�[m
�[32m+�[m�[32mdefine ("REPORT_COMPONENT_PRINTER_FRIENDLY_HEADER", "100");�[m
define ("REPORT_COMPONENT_PHYSICAL_PHYSICAL_EXAM", "101"); // Physical Physical -- I meant to do that�[m
define ("REPORT_COMPONENT_PHYSICAL_ESCREEN_DRUG_SCREEN", "102");�[m
define ("REPORT_COMPONENT_INCART_ACCEPTANCE_MARKETING", "103");�[m
�[1mdiff --git a/core/inc/uberreport.inc.php b/core/inc/uberreport.inc.php�[m
�[1mold mode 100644�[m
�[1mnew mode 100755�[m
�[1mindex 36f768f..202d377�[m
�[1m--- a/core/inc/uberreport.inc.php�[m
�[1m+++ b/core/inc/uberreport.inc.php�[m
�[36m@@ -173,6 +173,9 @@�[m �[mclass UberReport�[m
public function DisplayUberReport($Owner, $GetUserObject, $applicantId, $isPrinterFriendlyPage = 0, $echoOut = TRUE)�[m
{�[m
global $SiteConfigCore;�[m
�[32m+�[m
�[32m+�[m�[32m // guarantee the define of the theme class.�[m
�[32m+�[m�[32m require_once('inc/template.inc.php');�[m
theme::factory()->addDir('screening/tpl'); // In case we don't have it yet�[m
�[m
// ReportContext supersedes isPrinterFriendlyPage�[m
�[36m@@ -971,18 +974,57 @@�[m �[mclass UberReport�[m
$includeFCRA = false;�[m
}�[m
�[m
�[31m- $civilCode = '';�[m
�[31m- if ($includeFCRA){�[m
�[31m- // for internation uberform, we do not show Civil code nor FCRA�[m
�[31m- $civilCode = 'Per California Civil Code 1786, ';�[m
�[32m+�[m�[32m // figure out what render version to use.�[m
�[32m+�[m�[32m $FakeReqProfile = array(�[m
�[32m+�[m�[32m 'App' => REPORT_COMPONENT_PRINTER_FRIENDLY_HEADER,�[m
�[32m+�[m�[32m 'CreateTime' => $this->m_CreateTime,�[m
�[32m+�[m�[32m );�[m
�[32m+�[m�[32m $FakeReportData = array();�[m
�[32m+�[m�[32m $renderVersion = screening_Report_UI::getRenderVersion($FakeReqProfile, $FakeReportData, $this->m_ReportContext);�[m
�[32m+�[m
�[32m+�[m�[32m if ($renderVersion === 1) {�[m
�[32m+�[m�[32m $civilCode = '';�[m
�[32m+�[m�[32m if ($includeFCRA){�[m
�[32m+�[m�[32m // for internation uberform, we do not show Civil code nor FCRA�[m
�[32m+�[m�[32m $civilCode = 'Per California Civil Code 1786, ';�[m
�[32m+�[m�[32m }�[m
�[32m+�[m
�[32m+�[m�[32m // 12pt font is a legal requirement that presumably applies to Web as well as print�[m
�[32m+�[m�[32m $legalTopHtml = '

'.$civilCode.$this->m_SiteName.' does not�[m
�[32m+�[m�[32m guarantee the accuracy or truthfulness of the information in this report as to the�[m
�[32m+�[m�[32m person who is the subject of the investigation, only that the information is accurately copied from�[m
�[32m+�[m�[32m public records. Information generated as a result of identity theft, including evidence of�[m
�[32m+�[m�[32m criminal activity, may be inaccurately associated with the person who is the subject of the report.
'."\r\n";�[m
�[32m+�[m�[32m } else {�[m
�[32m+�[m�[32m // New and Improved, with a fresh spring scent!�[m
�[32m+�[m�[32m // 12pt font is a legal requirement that presumably applies to Web as well as print�[m
�[32m+�[m�[32m $legalTopHtml = '
�[m
�[32m+�[m�[32m California Applicants/Employees Only: The report does not guarantee the�[m
�[32m+�[m�[32m accuracy or truthfulness of the information as to the subject of the�[m
�[32m+�[m�[32m investigation, but only that it is accurately copied from public records,�[m
�[32m+�[m�[32m and information generated as a result of identity theft, including�[m
�[32m+�[m�[32m evidence of criminal activity, may be inaccurately associated with the�[m
�[32m+�[m�[32m consumer who is the subject of the report. An investigative consumer�[m
�[32m+�[m�[32m reporting agency shall provide a consumer seeking to obtain a copy of a�[m
�[32m+�[m�[32m report or making a request to review a file, a written notice in simple,�[m
�[32m+�[m�[32m plain English and Spanish setting forth the terms and conditions of his�[m
�[32m+�[m�[32m or her right to receive all disclosures, as provided in Section�[m
�[32m+�[m�[32m 1786.26.
�[m
�[32m+�[m�[32m
�[m
�[32m+�[m�[32m Sólo para los Solicitantes/Empleados de California: En el informe no se�[m
�[32m+�[m�[32m garantiza la exactitud o veracidad de la información en cuanto al tema�[m
�[32m+�[m�[32m de la investigación, sino sólo que se ha copiado exactamente de los�[m
�[32m+�[m�[32m registros públicos, y la información generada como resultado del robo�[m
�[32m+�[m�[32m de identidad, incluyendo las pruebas de una actividad delictiva, podría�[m
�[32m+�[m�[32m estar incorrectamente asociada con el consumidor que sea el sujeto del�[m
�[32m+�[m�[32m informe. Una agencia investigadora de informes de crédito deberá�[m
�[32m+�[m�[32m suministrarle a un consumidor que trate de obtener una copia de un�[m
�[32m+�[m�[32m informe o solicite revisar un archivo una notificación por escrito en�[m
�[32m+�[m�[32m inglés y español lisos y llanos, en la que se establezcan los términos�[m
�[32m+�[m�[32m y las condiciones de su derecho a recibir toda la información, como se�[m
�[32m+�[m�[32m dispone en la Sección 1786.26.�[m
�[32m+�[m�[32m
'."\r\n";�[m
}�[m
�[31m-�[m
�[31m- // 12pt font is a legal requirement that presumably applies to Web as well as print�[m
�[31m- $legalTopHtml = '
'.$civilCode.$this->m_SiteName.' does not�[m
�[31m- guarantee the accuracy or truthfulness of the information in this report as to the�[m
�[31m- person who is the subject of the investigation, only that the information is accurately copied from�[m
�[31m- public records. Information generated as a result of identity theft, including evidence of�[m
�[31m- criminal activity, may be inaccurately associated with the person who is the subject of the report.
'."\r\n";�[m
}�[m
�[m
$legalBottomHtml = '';�[m
�[1mdiff --git a/tests/unit/DataProvider/UserProvider.php b/tests/unit/DataProvider/UserProvider.php�[m
�[1mnew file mode 100755�[m
�[1mindex 0000000..80cf4d2�[m
�[1m--- /dev/null�[m
�[1m+++ b/tests/unit/DataProvider/UserProvider.php�[m
�[36m@@ -0,0 +1,34 @@�[m
�[32m+�[m�[32m�[m
\ No newline at end of file�[m
�[1mdiff --git a/tests/unit/core/inc/UberReportTest.php b/tests/unit/core/inc/UberReportTest.php�[m
�[1mnew file mode 100755�[m
�[1mindex 0000000..44da4b2�[m
�[1m--- /dev/null�[m
�[1m+++ b/tests/unit/core/inc/UberReportTest.php�[m
�[36m@@ -0,0 +1,49 @@�[m
�[32m+�[m�[32muberReport = $uberReport;�[m �[32m+�[m�[32m }�[m �[32m+�[m �[32m+�[m �[32m+�[m�[32m // This is the weakest unit test ever.�[m �[32m+�[m�[32m // We call it, and make sure the report has the header we coded for.�[m �[32m+�[m�[32m public function testGetUberFormUser()�[m �[32m+�[m�[32m {�[m �[32m+�[m�[32m $userId = 16520012;�[m �[32m+�[m�[32m $userProvider = new UserProvider();�[m �[32m+�[m�[32m $Owner = $userProvider->getUser($userId);�[m �[32m+�[m�[32m $GetUserObject = array($userId);�[m �[32m+�[m�[32m $applicantId = 60924957;�[m �[32m+�[m�[32m // This is critical to our test. It MUSt be a printer friendly page to have the header.�[m �[32m+�[m�[32m $isPrinterFriendlyPage = 1;�[m �[32m+�[m�[32m $echoOut = false;�[m �[32m+�[m �[32m+�[m�[32m $this->uberReport->DisplayUberReport($Owner, $GetUserObject, $applicantId, $isPrinterFriendlyPage, $echoOut);�[m �[32m+�[m �[32m+�[m�[32m // Lets see what damage it's wrought.�[m �[32m+�[m�[32m $className = "UberReport";�[m �[32m+�[m�[32m $propertyName = "m_ReportHtml";�[m �[32m+�[m�[32m $object = $this->uberReport;�[m �[32m+�[m�[32m $m_ReportHtml = $this->getPrivateProperty($className, $propertyName, $object);�[m �[32m+�[m �[32m+�[m�[32m // ALL we changed is that printed reports, done AFTER the params date should have the header section.�[m �[32m+�[m�[32m $this->assertTrue(strstr($m_ReportHtml, '1786.26') !== true, "Report does NOT have the correct 1786.26 header.");�[m �[32m+�[m�[32m }�[m �[32m+�[m�[32m}�[m �[32m+�[m�[32m?>�[m
\ No newline at end of file�[m

ps_mem on Linux 3.0

First of all, thank you very much for this wonderfull little program, then the issue :).

I am on Arch Linux. Recently I updated to linux 3.0 and ps_mem have not worked. I use a alias pointing to ps_mem.py which I renamed as mem.py. Here is the traceback:

Traceback (most recent call last):
File "/home/_/mem.py", line 124, in
kv=kernel_ver()
File "/home/
_
/mem.py", line 120, in kernel_ver
kv[2]=kv[2].split(char)[0]
IndexError: list index out of range

Hope it will be fixed soon. Thanks.

[PATCH] ps_mem.py: Ennobling the -s switch

Hello.

The following patch changes the longopt variant of the -s switch to a more intuitive one and adds the -s switch to the help/usage.

http://jcapik.fedorapeople.org/files/ps_mem/patches/ps_mem-ennobling-the-s-switch.patch

Please, check and apply.

Thanks in advance.

Regards,
Jaromir.

Jaromir Capik
Red Hat Czech, s.r.o.
Software Engineer / Secondary Arch

Email: [email protected]
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkynova 99/71, 612 45, Brno, Czech Republic
IC: 27690016

Error in V2.5

I've found a problem with this version when run whith Python 3.2.1.

The problem is the next:
File "./ps_mem.py", line 133
except (IOError, OSError) value:
^
SyntaxError: invalid syntax

I corrected this with change the , with as

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.