Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,244
» Latest member: dangyc
» Forum threads: 4,031
» Forum posts: 16,406

Full Statistics

Online Users
There are currently 541 online users.
» 0 Member(s) | 538 Guest(s)
Baidu, Bing, Google

Latest Threads
how to allow only steam t...
Forum: Xorg Problems
Last Post: moquber
2026-03-17, 09:40 PM
» Replies: 0
» Views: 299
Wi-Fi works for a few min...
Forum: Network Problems
Last Post: kabifff
2025-12-15, 12:57 AM
» Replies: 0
» Views: 673
How to install Archboot i...
Forum: Network Problems
Last Post: Meup
2025-05-13, 01:41 PM
» Replies: 0
» Views: 4,031
clear logs in smoothwall
Forum: Security and Firewalls
Last Post: amanda63
2024-03-10, 03:27 PM
» Replies: 8
» Views: 125,247
I cannot install RedHat 8...
Forum: Redhat
Last Post: hybrid
2023-11-11, 01:01 PM
» Replies: 1
» Views: 75,399
How things are done, usin...
Forum: Xorg Problems
Last Post: ross
2023-09-04, 09:03 AM
» Replies: 0
» Views: 5,407
Im back.....
Forum: Hello
Last Post: anyweb
2021-01-17, 11:36 AM
» Replies: 1
» Views: 9,229
add mp3 plugin to xmms in...
Forum: Fedora
Last Post: anyweb
2021-01-17, 11:30 AM
» Replies: 11
» Views: 47,570
Configuring VSFTPd Server
Forum: FTP Server
Last Post: Johnbaca
2020-10-14, 10:25 AM
» Replies: 32
» Views: 166,537
Wolf won't play sound!
Forum: Game Problems
Last Post: Guest
2020-10-03, 05:51 PM
» Replies: 1
» Views: 98,059

 
  emacs tricks
Posted by: grep420 - 2003-12-24, 04:08 PM - Forum: Tips and Tricks - Replies (4)


I am posting this for nforbes. - grep420

 

One of the great things about emacs is that you can change the looks of it by editing files in a programming language called "lisp". It's actually a very simple programming language, and with the help of emacs, it can become quite useful. Let's get started.

 

First, open up emacs, and get up a find file in the minibuffer. This can be accomplished by pressing ^X-^F (^ means Ctrl). It should look similar to this:



Code:
Find file: ~/




 

Locate the file ~/.emacs, and open it. .emacs is the file that emacs trys to autoload to get settings from. If it doesn't exist, let emacs create it for you. Now we can start doing some cool things. Most commands in lisp for emacs look like this:



Code:
(set-variable 'option value)




 

These options are equivalent to pressing M-X (M means Alt), and then the option. For example, try M-X global-font-lock-mode. This is the same as writing (set-variable 'global-font-lock-mode t) in your .emacs. However, by putting that line in your .emacs, every time emacs starts, it will automatically execute M-X global-font-lock-mode. Pretty neat, huh?

 

A good way to edit your .emacs is to use the built-in emacs customization interface. Type M-X customize-browse. You can browse through all the settings available to emacs here. When you select to turn one on (or off), it will automatically add that to your .emacs as if you had written it yourself!

 

Next, let's do some key bindings. These are neat because you don't have to remember specific M-X commands, just the key that executes them. Let's see how we can have F1 and Shift-F1 move forward and backward in the buffers.

 

Some people like to have a different file for key bindings, and they generally put this in the /usr/share/emacs/site-lisp (or wherever your site-lisp directory might happen to be). By doing this, you can easily organize all your emacs settings. So get up the find file dialog in the minibuffer again, and (making sure you are root for this one), open /usr/share/emacs/site-lisp/site-keys.el. .el is the extension used for emacs lisp files.

 

Let's make a new keybinding. this can be accomplished by doing



Code:
(global-set-key [key]  'option)




 

We want to bind F1 to 'go to the next buffer' (the command for this is 'exhume-buffer'), and Shift-F1 to 'go to the previous buffer' (the command for this is 'bury-buffer'), so what we can do is this:



Code:
(global-set-key [f1]  'exhume-buffer)
(global-set-key [(shift f1)]    'bury-buffer)




 

Note the parenthesis around "shift f1". emacs does not have an interface (that I know of) for adding new key bindings, so you'll have to write this file yourself.

 

emacs does not automatically load the files in /usr/share/emacs/site-lisp, so we'll have to add this file as a library to our .emacs. Switch to your .emacs buffer (M-X bury-buffer until we load these key bindings), and add a library line:



Code:
(load-library "library-name")




 

By default, emacs loads libraries from its shared site-lisp directory. If you saved this file somewhere else, include the path to the library as well.

 

You can also customize emacs' colors. Again, it's good to put these in a seperate file, so open up /usr/share/emacs/site-lisp/primary-faces.el

 

Let's just do some easy stuff. You should be able to catch on to these settings, so I won't bother explaining all of them.

 



Code:
(set-background-color "black")
(make-face 'default)
(set-face-background  'default "black")
(set-face-foreground  'default "gray90")
(copy-face 'default   'bold)
(copy-face 'default   'italic)
(copy-face 'default   'bold-italic)
(copy-face 'bold      'zmacs-region)
(copy-face 'bold      'isearch)
(copy-face 'bold      'highlight)
(copy-face 'bold      'primary-selection)
(copy-face 'bold      'secondary-selection)
(copy-face 'default   'left-margin)
(copy-face 'default   'right-margin)
(set-face-background  'zmacs-region  "steelblue"   )
(set-face-foreground  'zmacs-region  "grey90"      )
(set-face-background  'isearch      "lightblue"   )
(set-face-foreground  'isearch      "black"       )
(set-face-background  'modeline      "deepskyblue4")
(set-face-foreground  'modeline      "linen"       )
(set-face-background  'highlight  "lightblue"   )
(set-face-foreground  'highlight  "black"       )
(set-face-background  'primary-selection    "steelblue3"  )
(set-face-background  'secondary-selection    "steelblue4"  )
(set-face-foreground  'secondary-selection    "grey90"      )

(provide 'primary-faces)




 

The one thing you may be curious about here is 'copy-face'. copy-face looks like this:



Code:
(copy-face 'face-from   'face-to)




 

It gives the 'face-to' face the attributes of the 'face-from' face, and nothing more.

 

That's pretty much how my primary-faces.el looks. Now we need to load the primary faces in our .emacs. This is accomplished by using a require require line (note: this is note a library because we use 'provide' in our file):



Code:
(require 'primary-faces)




 

There's a lot more customization available in emacs; this is just the tip of the iceberg. For other commands, you can type ^H-I and scroll to the 'Elisp' section. Be sure to check out some of the other help topics available, too.

 

If you have any questions about this tutorial, feel free to send me an email (<nomafo@bellsouth.net>), or hop on irc.blessed.net (EFNet) and join #redhat.

 

Enjoy!

--Noel

Print this item

  postfix + spamassassin
Posted by: hijinks - 2003-12-24, 02:39 PM - Forum: Tips and Tricks - No Replies


This is a simple doc on how to get spamassassin and postfix working together. This doc is targeted towards people with Redhat or Fedora. I also use apt-get. If you don't, you are missing out. Grab it at [/url]http://apt.freshrpms.net.

 

I like postfix mainly because its proven itself as being a fast and secure MTA. It is also very simple to configure unlike sendmail.

 

Lets grab the needed rpms using apt-get. Chances are apt-get will prompt you to install other needed rpms, just hit yes and let them install

 



Code:
apt-get install postfix spamassassin redhat-switch-mail




 

Now that you have all the needed rpms installed lets make sure sendmail won't start on startup and the SA and postfix will load on startup

 



Code:
chkconfig sendmail off
service sendmail stop
chkconfig spamassassin on
chkconfig postfix on




 

Now lets just the switch-mail program to make sure postfix is our default MTA

 



Code:
redhat-switch-mail




 

Then select postfix and hit ok. It'll change some symlinks to make sure that postfix is the default MTA. Now we are ready to start to config SA and postfix to end spam for good

 

So we need to create a spam user and also a homer dir for the spam user then make sure all the permissions are ok

 



Code:
groupadd spam
adduser -g spam -d /var/spam spam
chown -R spam:spam /var/spam




 

Now that the spam user is setup we have to make a spamfilter file. This is the file that will run the mail through spamassassin. create a file in /usr/local/bin/spamfilter.sh and insert the following lines into the file

 



Code:
#!/bin/sh
INSPECT_DIR=/var/spam
SENDMAIL=/usr/sbin/sendmail
SPAMASSASSIN=/usr/bin/spamc
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
trap "rm -f in.$$; rm -f out.$$" 0 1 2 3 15
cat | $SPAMASSASSIN -f > out.$$ #|| # { echo Message content rejected; exit $EX_UNAVAILABLE; }
$SENDMAIL "$@" < out.$$
exit $?




 

Now that the file is made we have to set the permissions and ownership for the file so that the user spam can run the file

 



Code:
chmod +x /usr/local/bin/spamfilter.sh
chown spam:spam /usr/local/bin/spamfilter.sh




 

Now lets setup postfix. edit the file /etc/postfix/main.cf. Below I have copied the lines I have edited in that file just as they appear BEFORE i edited them. Its up to you to change them. If you see a # in front make sure you remove it. If you don't see one then just edit that line. Ignore the () on the line.. they are my notes to you.

 



Code:
#myhostname = host.domain.tld (host.domain.com)
#mydomain = domain.tld (domain.com)
#myorigin = $mydomain (just remove the #)

inet_interfaces = localhost (add a # in front)
#inet_interfaces = all ( remove the # in front)

#mydestination = $myhostname, localhost.$mydomain  (add a # in front)
mydestination = $myhostname, localhost.$mydomain $mydomain l ( remove the # in front)

#mynetworks_style = subnet
#mynetworks = 168.100.189.0/28, 127.0.0.0/8  (make sure you edit the first string)

#mail_spool_directory = /var/spool/mail




 

Thats it for main.cf. Now lets edit the file /etc/postfix/master.cf Below I will show the originals then what you should chanjge it to

 

smtp inet n - y - - smtpd

change it to look like this

smtp inet n - n - - smtpd -o content_filter=spamfilter:dummy

 

then scroll down to the bottom of the file and add the following. NOTE! the following line should just be one line in the file

 

spamfilter unix - n n - - pipe flags=Rq user=spam argv=/usr/local/bin/spamfilter.sh ${sender} ${recipient}

 

Now you are done with that. So the last thing to do is change how spamassassin is started. Edit the file /etc/sysconfig/spamassassin

 

 



Code:
# Options to spamd
SPAMDOPTIONS="-d -c -a -u spam -H /var/spam"




 

The last thing we have to edit is the SA config. It is located at /etc/mail/spamassassin/local.cf. I have an example one at www.zcentric.com/local.cf or use [url=http://www.yrex.com/spam/spamconfig.php]http://www.yrex.com/spam/spamconfig.php to generate your own.

 

Once you have created your own local.cf file you can move on to the next step

 

Now lets startup SA and postfix and do some testing!

 



Code:
service spamassassin start
service postfix start




 

Then test it out. Make sure you send mail from an outside host. SA does not seem to process it if you send it from the same host that the mailserver is running. You should see something like this in the headers

 

 

 



Code:
X-Spam-Status: No, hits=1.1 required=7.0
       tests=DATE_IN_PAST_03_06,SPAM_PHRASE_00_01
       version=2.44
X-Spam-Level: *




 

As you can see I have my limit set at 7 and my test mail got a 1.1 rating. So it doesn't get marked as spam. If its above 7.0 then it'll change the subject to ****SPAM**** before the real subject. Then I have a filter setup on my mailclient to move all mails with that in the subject to a spam folder. You can make SA delete all spam also. Read the SA docs and its all done in the local.cf file

 

ANother great tip from the J to the Y. Damn i rule

Print this item

  KobrAs :)
Posted by: KobrAs - 2003-12-24, 11:25 AM - Forum: Hello - Replies (4)


Hey all ... I`m KobrAs, real name bogdan :)I'm from Romania ... far far far away :)16 old. Finished cisco CCNA1, loving LINUX :)but still using windows :/ cause some mother/sister problems :)... the girls dont understand LINUX !

heh

and thats all

Print this item

  happy christmas from linux-noob.com
Posted by: anyweb - 2003-12-24, 10:48 AM - Forum: Site News - Replies (4)


happy christmas everyone,

 

thanks for joining and thanks for being part of the forums,

 

lets look forward to next year getting better and better,

 

i hope you all have a wonderful christmas, lots of drink and fun and presents and some time to relax and unwind

 

cheers

 

anyweb

Print this item

  my car
Posted by: anyweb - 2003-12-23, 11:36 PM - Forum: General Chat - Replies (20)


check it out, ive just taken the dashboard out ...

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-1-1072222595.jpg" data-fileid="15">[img]<fileStore.core_Attachment>/post-1-1072222595.jpg[/img]</a>



Attached Files
.jpg   december_206.jpg (Size: 1.13 MB / Downloads: 391)
Print this item

  XFCE in Fedora
Posted by: Guest - 2003-12-23, 10:40 PM - Forum: How Do I? - Replies (1)


does anyone here knows how to install xfce in fedora. I found the rpms for shrike on [/url][url=http://www.xfce.org]http://www.xfce.org and install it sucessfully but i am unable to get it working for the dm session <Session Window> in the Login.

I still have the default choices of KDE Gnome Failsafe and default, and i was expecting an XFCE entry would be there but its not.

So i checked if XFCE 4 is installed properly by checking the script /etc/X11/gdm/Sessions/XFCe* which is an executable and execute it and it ran fine but the xfce entry in the sessions window in the login interface is still not available.

now i freakin added XCfe.desktop to /etc/X11/dm/sessions but still no luck ;(

 

any comments would be helpful

Print this item

  apache howto by [Strabo]
Posted by: anyweb - 2003-12-23, 04:38 PM - Forum: LAMP - No Replies


good reading :)

 

[/url][url=http://www.xn85turbo.com/website.txt]http://www.xn85turbo.com/website.txt

 

cheers

 

anyweb

Print this item

  Another Flux, RH9
Posted by: kZo - 2003-12-23, 04:28 PM - Forum: Linux - Replies (3)


Terminal Services running at 450x450 :)

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-11-1072196924.png" data-fileid="13">[img]<fileStore.core_Attachment>/post-11-1072196924.png[/img]</a>



Attached Files
.png   screensnap.png (Size: 630.59 KB / Downloads: 0)
Print this item

  clanhtas.net website defaced
Posted by: anyweb - 2003-12-23, 12:59 PM - Forum: Game Problems - Replies (10)


hi guys

 

the site was defaced probably due to really old openssl versions etc

 

heres the servers details

 

Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.2 PHP/4.3.4 FrontPage/5.0.2.2634 mod_ssl/2.8.16 OpenSSL/0.9.6b

 

its more than likely rootkitted by now

 

ive put up a temp index.php page just to alert people that its down but below is a screenshot of the defaced page

 

cheers

 

anyweb

<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/post-38-1072184360.png" data-fileid="12">[img]<fileStore.core_Attachment>/post-38-1072184360.png[/img]</a>



Attached Files
.png   Screenshot_1.png (Size: 91.38 KB / Downloads: 0)
Print this item

  Ello
Posted by: warthog - 2003-12-22, 11:50 PM - Forum: Hello - Replies (5)


Hello noob!!!!!

I am a prat, just so you all know :P I dont know anything about computers or operating systems or networking or firewalls.

The only thing i know about Windows is that they usually are made from glass and break easy. So dont ask me any questions OK...

 

 

 

other than that....

 

I like the forums dude... need a lesson in this i think...

 

/the HOG

Print this item