Sponsored Content
Full Discussion: regex to find font class
Top Forums Shell Programming and Scripting regex to find font class Post 302480749 by tlarkin on Wednesday 15th of December 2010 05:16:08 PM
Old 12-15-2010
Quote:
Originally Posted by verdepollo
Unfortunately I don't have a Mac OS at hand, but what "ton of stuff" is it finding?
Looks like anything involved with fonts in every directory. Here is just a snip of the output:

Code:
bash-3.2$ find -x -E /* -iname "*arial*" -type f -print
/Applications/Microsoft Office 2004/Office/Fonts/Arial
/Applications/Microsoft Office 2004/Office/Fonts/Arial Black
/Applications/Microsoft Office 2004/Office/Fonts/Arial Narrow
/Applications/Microsoft Office 2004/Office/Fonts/Arial Rounded Bold
find: /Library/Application Support/Apple/ParentalControls/Users: Permission denied
find: /Library/Application Support/Apple/Remote Desktop/Client: Permission denied
find: /Library/Application Support/Apple/Remote Desktop/Task Server: Permission denied
find: /Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/.Spotlight-V100: Permission denied
find: /Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Application Support/Apple/ParentalControls/Users: Permission denied
find: /Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Application Support/Apple/Remote Desktop/Client: Permission denied
find: /Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Application Support/JAMF/Downloads: Permission denied
find: /Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Application Support/JAMF/Usage: Permission denied
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Black.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Bold Italic.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Bold.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Italic.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Narrow Bold Italic.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Narrow Bold.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Narrow Italic.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Narrow.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Rounded Bold.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial Unicode.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/Arial.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/ArialHB.ttf
/Library/Application Support/JAMF/Composer/Sources/netboot/ROOT/Library/Fonts/ArialHBBold.ttf
^Z
[19]+  Stopped                 find -x -E /* -iname "*arial*" -type f -print
bash-3.2$

Like look at the parental controls....not sure why it is picking that up.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find with RegEx

I have some files in unix ls -1 TMH.backend.tar.421E-03.Z TMH.backend.tar.421E-04.Z TMH.backend.tar.421E-05.Z TMH.backend.tar.421E-06.Z TMH.backend.tar.421E-07.Z TMH.backend.tar.421E-08.Z TMH.backend.tar.421E-08.Z.bak20081223164844 TMH.backend.tar.421E-09.Z... (1 Reply)
Discussion started by: on9west
1 Replies

2. Shell Programming and Scripting

Using grep and regular expression to find class references in a c++ file

I'm trying to math all class references in a C++ file using grep with regular expression. I'm trying to know if a specific include is usuless or not, so I have to know if there is a refence in cpp. I wrote this RE that searches for a reference from class ABCZ, but unfortunately it isn't working... (0 Replies)
Discussion started by: passerby
0 Replies

3. Linux

Command to find default font name in Ubuntu OS

Hi, Does anyone know whether there is any console command available to get the info of the default Ubuntu OS or any config file where in I search for the font details? I am using Ubuntu 8.04 and 10.04 (LTS) both together. Thanks (1 Reply)
Discussion started by: royalibrahim
1 Replies

4. UNIX for Dummies Questions & Answers

GREP Find & Replace <p class>

I am making an eBook. I am editing the html in BBedit. I need to replace all <p class="s5"> with just a <p>. How do I write this for GREP? Thank you, Abby (5 Replies)
Discussion started by: cuddlykitty
5 Replies

5. UNIX for Advanced & Expert Users

Get pointer for existing device class (struct class) in Linux kernel module

Hi all! I am trying to register a device in an existing device class, but I am having trouble getting the pointer to an existing class. I can create a class in a module, get the pointer to it and then use it to register the device with: *cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies

6. Shell Programming and Scripting

Perl::Gtk2 on Linux --- How to Find the Default Font Being Used?

Hello All, Wasn't sure if this was the correct thread to post this under but figured it has to do with Perl and Gtk2 so why not... Anyway.. How can I find out what the Default font being used is inside a Gtk2::Widget. In this case I'm trying to figure out the font being used inside a... (1 Reply)
Discussion started by: mrm5102
1 Replies

7. UNIX for Advanced & Expert Users

Could not find the main class: Grasp. Program will exit.

I am having trouble running jgrasp. I get the message above when I try to run jgrasp. I am running fedora if that makes a difference. I have already set my environmental variable with this. Hopefully I did it right. JGRASP_HOME=/opt/jgrasp export... (0 Replies)
Discussion started by: cokedude
0 Replies

8. Programming

Size of Derived class, upon virtual base class inheritance

I have the two class definition as follows. class A { public: int a; }; class B : virtual public A{ }; The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Discussion started by: techmonk
2 Replies

9. Programming

C++ : Base class member function not accessible from derived class

Hello All, I am a learner in C++. I was testing my inheritance knowledge with following piece of code. #include <iostream> using namespace std; class base { public : void display() { cout << "In base display()" << endl; } void display(int k) {... (2 Replies)
Discussion started by: anand.shah
2 Replies

10. Shell Programming and Scripting

Regex issue with \s in character class.

Anybody have an explanation for why \s doesn't match ' ' in a character class? Here are 3 examples with the final example showing that \s in a character class (demonstrated by using egrep -o) fails: \s works outside of class.. # echo " FOO " | egrep -o '\s+\s' FOO Here is a... (6 Replies)
Discussion started by: blackrageous
6 Replies
CGI::Application::Plugin::CAPTCHA(3pm)			User Contributed Perl Documentation		    CGI::Application::Plugin::CAPTCHA(3pm)

NAME
CGI::Application::Plugin::CAPTCHA - Easily create, use, and verify CAPTCHAs in CGI::Application-based web applications. VERSION
Version 0.04 SYNOPSIS
# In your CGI::Application-based web application module. . . use CGI::Application::Plugin::CAPTCHA; sub setup { my $self = shift; $self->run_modes([ qw/ create # Your other run modes go here /]); $self->captcha_config( IMAGE_OPTIONS => { width => 150, height => 40, lines => 10, font => "/Library/Fonts/Arial", ptsize => 18, bgcolor => "#FFFF00", }, CREATE_OPTIONS => [ 'ttf', 'rect' ], PARTICLE_OPTIONS => [ 300 ], ); } # Create a run mode that calls the CAPTCHA creation method... sub create { my $self = shift; return $self->captcha_create; } # In a template far, far away. . . <img src="/delight/Ident/create"> (to generate a CAPTCHA image) # Back in your application, to verify the CAPTCHA... sub some_other_runmode { my $self = shift; my $request = $self->query; return unless $self->captcha_verify($request->cookie("hash"), $request->param("verify")); } DESCRIPTION
"CGI::Application::Plugin::CAPTCHA" allows programmers to easily add and verify CAPTCHAs in their CGI::Application-derived web applications. A CAPTCHA (or Completely Automated Public Turing Test to Tell Computers and Humans Apart) is an image with a random string of characters. A user must successfully enter the random string in order to submit a form. This is a simple (yet annoying) procedure for humans to complete, but one that is significantly more difficult for a form-stuffing script to complete without having to integrate some sort of OCR. CAPTCHAs are not a perfect solution. Any skilled, diligent cracker will eventually be able to bypass a CAPTCHA, but it should be able to shut down your average script-kiddie. "CGI::Application::Plugin::CAPTCHA" is a wrapper for GD::SecurityImage. It makes it more convenient to access GD::SecurityImage functionality, and gives a more CGI::Application-like way of doing it. When a CAPTCHA is created with this module, raw image data is transmitted from your web application to the client browser. A cookie containing a checksum is also transmitted with the image. When the client submits their form for processing (along with their verification of the random string), "captcha_verify()" generates a checksum of the verification string the user entered. If the newly generated checksum matches the checksum found in the cookie, we trust that the CAPTCHA has been successfully entered, and we allow the user to continue processing their form. The checksum is generated by taking the string in question, and joining it with a SECRET. We then generate an SHA1 hex digest of the resulting string. The end user will not be able to generate their own checksums to bypass the CAPTCHA check, because they do not know the value of our SECRET. This means it is important to choose a good value for your SECRET. An easy way to generate a relatively good secret is to run the following perl snippet: perl -MDigest::SHA=sha1_base64 -le 'print sha1_base64($$,time(),rand(9999))' The author recognizes that the transmission of a cookie with the CAPTCHA image may not be a popular decision, and welcomes any patches from those who can provide an equally easy-to-implement solution. FUNCTIONS
captcha_config() This method is used to customize how new CAPTCHA images will be created. Values specified here are passed along to the appropriate functions in GD::SecurityImage when a new CAPTCHA is created. It is recommended that you call "captcha_config()" in the "cgiapp_init()" method of your CGI::Application base class, and in the "setup()" method of any derived applications. The following parameters are currently accepted: IMAGE_OPTIONS This specifies what options will be passed to the constructor of GD::SecurityImage. Please see the documentation for GD::SecurityImage for more information. CREATE_OPTIONS This specifies what options will be passed to the "create()" method of GD::SecurityImage. Please see the documentation for GD::SecurityImage for more information. PARTICLE_OPTIONS This specifies what options will be passed to the "particle()" method of GD::SecurityImage. Please see the documentation for GD::SecurityImage for more information. SECRET This specifies the secret that will be used when generating the checksum hash. captcha_create() Creates the CAPTCHA image, and return a cookie with the encrypted hash of the random string. Takes no arguments. The cookie created in this method is named "hash", and contains only the encrypted hash. Future versions of this module will allow you to specify cookie options in greater detail. captcha_verify() Verifies that the value entered by the user matches what was in the CAPTCHA image. Argument 1 is the encrypted hash from the cookie sent by "captcha_create()", and argument 2 is the value the user entered to verify the CAPTCHA image. Returns true if the CAPTCHA was successfully verified, else returns false. AUTHOR
Jason A. Crome, "<cromedome@cpan.org>" TODO
o Allow "captcha_config()" to take cookie configuration arguments. o Allow the plugin to actually create a run mode in your CGI::Application-based webapp without the developer having to manually create one. BUGS
Please report any bugs or feature requests to "bug-cgi-application-plugin-captcha@rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-CAPTCHA <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI- Application-Plugin-CAPTCHA>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. CONTRIBUTING
Patches, questions, and feedback are welcome. ACKNOWLEDGEMENTS
A big thanks to Cees Hek for providing a great module for me to borrow code from (CGI::Application::Plugin::Session), to Michael Peters and Tony Fraser for all of their valuable input, and to the rest who contributed ideas and criticisms on the CGI::Application mailing list. Additional thanks to chorny and Cees for the various bug fixes and patches they have submitted. SEE ALSO
CGI::Application GD::SecurityImage Wikipedia entry for CAPTCHA - <http://en.wikipedia.org/wiki/Captcha> COPYRIGHT &; LICENSE Copyright 2005-2011 Jason A. Crome, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2011-11-10 CGI::Application::Plugin::CAPTCHA(3pm)
All times are GMT -4. The time now is 05:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy