# Apt-sary-0.1

**URL:** <https://www.ruby-forum.com/t/apt-sary-0-1/73631>\
**Category:** Ruby\
**Created:** [December 20, 2005, 6:34pm UTC](https://www.ruby-forum.com/t/apt-sary-0-1/73631 "2005-12-20T18:34:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 20, 2005, 6:34pm UTC](https://www.ruby-forum.com/t/apt-sary-0-1/73631/1 "2005-12-20T18:34:32Z")

</div>

Hi,

== Abstract

Sary makes `apt-cache search' and `apt-file search’ MUCH FASTER.  
Using apt-sary is very easy!  
Only replace `apt-' with `apt-sary-'.

It is available at  
[http://www.rubyist.net/~rubikitch/computer/apt-sary/index.en.html](http://www.rubyist.net/~rubikitch/computer/apt-sary/index.en.html)

== What’s new

=== [2005/12/21] 0.1 released  
Initial release

== Install  
Please execute the following commands.

apt-get install rake sary apt apt-file  
ruby -ropen-uri -e  
‘URI(“[http://www.rubyist.net/~rubikitch/archive/apt-sary-0.1.tar.gz](http://www.rubyist.net/~rubikitch/archive/apt-sary-0.1.tar.gz)”).read.display’

> apt-sary-0.1.tar.gz  
> tar xzvf apt-sary-0.1.tar.gz

When you failed, please download it from the next link.

- 

((\<apt-sary-0.1.tar.gz|URL:[http://www.rubyist.net/~rubikitch/archive/apt-sary-0.1.tar.gz](http://www.rubyist.net/~rubikitch/archive/apt-sary-0.1.tar.gz)\>))

Then, install it.

ruby setup.rb  
apt-sary-mksary

== Examples

apt-sary-cache search dpkg-reconfigure  
speeds up  
apt-cache search dpkg-reconfigure

apt-sary-file search dpkg-reconfigure  
speeds up  
apt-file search dpkg-reconfigure

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 28, 2005, 11:39pm UTC](https://www.ruby-forum.com/t/apt-sary-0-1/73631/2 "2005-12-28T23:39:37Z")

</div>

On Thu, Dec 29, 2005 at 07:22:53AM +0900, Jan ‘jast’ Krueger wrote:

> –
> 
> # Best regards, Jan ‘jast’ Krueger
> 
> print’text: ‘;l=gets;I=[’%q,0-9a-f,‘,’,‘,’%q,(-/:-@[,‘];i=“pack”+  
> “(‘H\*’)”;l=eval(“l.un#{i}[0].tr #{I}”); $\>\<\<“$\>\<\<[%q\_#{l.gsub /(^  
> \W{64}|\W{72})/x,”\1\n"}\_.\ngsub(/\s/,’').tr(#{I.reverse})]."+i

I have a question:

What exactly does that bit of obfu do?

–  
Chad P. [CCD CopyWrite | [http://ccd.apotheon.org](http://ccd.apotheon.org) ]

unix virus: If you’re using a unixlike OS, please forward  
this to 20 others and erase your system partition.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 28, 2005, 11:24pm UTC](https://www.ruby-forum.com/t/apt-sary-0-1/73631/3 "2005-12-28T23:24:32Z")

</div>

Hi,

> Sary makes `apt-cache search' and`apt-file search’ MUCH FASTER.

Brilliant idea, thanks!

> apt-sary-mksary

This fails here with the following message:

— snip —  
head -100 | egrep -B100 ‘^FILE +LOCATION’ \> header.txt  
rake aborted!  
Command failed with status (): [head -100 | egrep -B100 ‘^FILE  
+LOCATION’…]  
— snip —

Could you update apt-sary-mksary to skip generating a contents sary when  
there are no contents files? I’ve written my own patch (don’t actually  
do  
anything in the rule if `cat’ ends up being nil) but it looks fairly  
ugly to me.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 29, 2005, 6:57am UTC](https://www.ruby-forum.com/t/apt-sary-0-1/73631/4 "2005-12-29T06:57:43Z")

</div>

On 12/29/05, Chad P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What exactly does that bit of obfu do?
> 
> –  
> Chad P. [CCD CopyWrite | [http://ccd.apotheon.org](http://ccd.apotheon.org) ]
> 
> unix virus: If you’re using a unixlike OS, please forward  
> this to 20 others and erase your system partition.

Something like obfuscator generator?

C:\Documents and Settings\Administrator\>ruby  
print’text: ‘;l=gets;I=[’%q,0-9a-f,‘,’,‘,’%q,(-/:-@[,‘];i=“pack”+  
“(‘H\*’)”;l=eval(“l.un#{i}[0].tr #{I}”); $\>\<\<“$\>\<\<[%q\_#{l.gsub /(^  
\W{64}|\W{72})/x,”\1\n"}_.\ngsub(/\s/,‘’).tr(#{I.reverse})]."+i  
 **END**  
text: Just another Ruby hacker!  
$\>\<\<[%q_,\</-/+/,_(.).@.[/,.:.-/\*\*(-_/-._/;_(.:.).+.=.-/**)(\<_.  
gsub(/\s/,‘’).tr(%q,(-/:-@[,%q,0-9a-f,)].pack(‘H\*’)  
C:\Documents and Settings\Administrator\>ruby  
$\>\<\<[%q_,\</-/+/,\*(.).@.[/,.:.-/**(-_/-._/;_(.:.).+.=.-/\*\*)(\<\_.  
gsub(/\s/,‘’).tr(%q,(-/:-@[,%q,0-9a-f,)].pack('H_’)  
**END**  
Just another Ruby hacker!

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 29, 2005, 2:04am UTC](https://www.ruby-forum.com/t/apt-sary-0-1/73631/5 "2005-12-29T02:04:33Z")

</div>

From: Jan ‘jast’ Krueger [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [ANN] apt-sary-0.1  
Date: Thu, 29 Dec 2005 07:22:53 +0900

Hi,

> head -100 | egrep -B100 ‘^FILE +LOCATION’ \> header.txt  
> rake aborted!  
> Command failed with status (): [head -100 | egrep -B100 ‘^FILE +LOCATION’…]

Please try this patch.

— apt-sary.rb (revision 1075)  
+++ apt-sary.rb (working copy)  
@@ -29,7 +29,7 @@

task :contents\_header do  
cat = FileList[“_Contents_.cat”][0]

- sh “head -100 #{cat} | egrep -B100 ‘^FILE +LOCATION’ \> header.txt”

- sh “head -100 #{cat} | egrep -B100 ‘^FILE +LOCATION’ \> header.txt” if  
cat  
end

task :contents =\> [$contents, :contents\_header].flatten

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 29, 2005, 1:44pm UTC](https://www.ruby-forum.com/t/apt-sary-0-1/73631/6 "2005-12-29T13:44:30Z")

</div>

Hi,

> Please try this patch.

that’s about what I did myself, and it works fine. So as it seems you  
wouldn’t do it differently, I suggest you include it in the next  
release.

I’m still overjoyed by the speedup, by the way. Thanks again, I guess.  
😉

(By the way, I just tried downloading and saryfying the contents  
database.  
Takes its sweet time, doesn’t it?)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 29, 2005, 1:44pm UTC](https://www.ruby-forum.com/t/apt-sary-0-1/73631/7 "2005-12-29T13:44:30Z")

</div>

Hi,

> > # Best regards, Jan ‘jast’ Krueger
> > 
> > print’text: ‘;l=gets;I=[’%q,0-9a-f,’,’,’,’%q,(-/:-@[,’];i=“pack”+  
> > “(‘H\*’)”;l=eval(“l.un#{i}[0].tr #{I}”); $\>\<\<"$\>\<\<[%q\_#{l.gsub /(^  
> > \W{64}|\W{72})/x,"\1\n"}\_.\ngsub(/\s/,’’).tr(#{I.reverse})]."+i
> 
> I have a question:  
> What exactly does that bit of obfu do?

As suggested, it generates obfuscated code that outputs a given string,  
formatted to make it suitable for e-mail signatures. I’m way too lazy to  
write my obfuscated signatures myself. 😉
