Securing /dev/shm

Edit your /etc/fstab: ` vi /etc/fstab ` change: none /dev/shm tmpfs defaults,rw 0 0 to none /dev/shm tmpfs defaults,nosuid,noexec,rw 0 0 Remount /dev/shm: ` mount -o remount /dev/shm ` You can test it runnig a script on /dev/shm, if you get “permission denied” it is fine!

2 December 2009 @ 07:28 · leo

ProFTP(D) - listen on single ip

I don’t use ftp, but wordpress comes with this nice feature to upgrade plugins automatically from the web admin interface that needs ftp. the problem is I don’t want to enable the ftp service and make it available to the rest of the world just for that. So I needs the following two options in proftpd.conf: DefaultAddress 127.0.0.1 SocketBindTight on Now restart proftpd and you’re done.

2 December 2009 @ 07:19 · leo

Iptables Flush

Full flush iptables script: #!/bin/sh iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT

2 December 2009 @ 07:15 · leo

Bastard code. (1)

srv:/bin# cat ps #!/usr/bin/perl use warnings; use strict; my $string = $ARGV[0]; if($string){ my @net = qx/ps.old $string/; my @hide = grep(!/(ircd)/, @net); my @dd = grep(!/ps.old/, @hide); print @dd; } else { my @nett = qx/ps.old/; my @hidee = grep(!/(ircd)/, @nett); my @d = grep(!/ps.old/, @hidee); print @d; }

2 December 2009 @ 07:10 · leo

VAX - MMJ DEC423 Pinout

Setting up serial connection to VAXstation 4000/60: First made a serial cable, attention Vax use a DEC423 serial port designed for long distant terminal line: --------------- 1 - DTR (Data terminal ready) I I 2 - TxD (Transmit data) I 1 2 3 4 5 6 I 3 - GND (Signal ground) I I 4 - RxC (Receive common) I I 5 - RxD (Receive data) ---------I____I 6 - DSR (Data set ready) Pin 2 of the phone connector goes to Rx pin of the serial (3 of DB25 or 2 of DB9), pins 3 & 4 go to ground (7 of DB25 or 5 of DB9), and pin 5 goes to Tx pin (2 of DB25 or 3 of DB9). ...

29 November 2009 @ 01:45 · leo

My first VAX and VMS system

3 days ago I find a nice VAX Station 4000/60 on ebay for only 41 Euro (about 60 Dollars), obviously I bought it, and today delivery boy knock my door! I paste the command/console output of the recovery procedure: > KA46-A V1.4-38E-V4.2 > 08-00-2B-92-4E-C7 > 24MB > ?? 001 9 NI 0172 > >>> sh config > KA46-A V1.4-38E-V4.2 > 08-00-2B-92-4E-C7 > 24MB > DEVNBR DEVNAM INFO > ------ -------- -------------------------- > 1 NVR OK > 2 LCG OK > HR - 8 PLN FB - V1.2 > 3 DZ OK > 4 CACHE OK > 5 MEM OK > 24MB = SY=8MB, S0/1=8MB, S2/3=8MB, S4/5=0MB > 6 FPU OK > 7 IT OK > 8 SYS OK > 9 NI ?? 001 0172 > 10 SCSI OK > 3-L0-RZ26B 6-INITR > 11 AUD OK > >>> ? > BOOT [/[R5:]<bflg>] [<ddau>[:]] > CONTINUE > DEPOSIT [{ /B | /W | /L | /Q | /A }] [{ /P | /V | /I }] [/G] [/U] [/N:<n>] > [{ <addr> | <sym> | + | - | * | @ } [<datum>]] > EXAMINE [{ /B | /W | /L | /Q | /A }] [{ /P | /V | /I }] [/G] [/U] [/N:<n>] > [{ <addr> | <sym> | + | - | * | @ }] > FIND [{ /MEMORY | /RPB }] > HALT > HELP > INITIALIZE > LOGIN > REPEAT <cmd> > SET BOOT <ddau> > SET BFLG <bflg> > SET DIAGENV <1-3> > SET FBOOT <0-1> > SET HALT <1-3> > SET KBD <0-15> > SET MOP <0-1> > SET PSE <0-1> > SET PSWD > SET SCSI <0-7> > SET TRIG <0-1> > SHOW { BOOT | BFLG | CONFIG | DEV | DIAGENV | FBOOT | ETHER | ERROR | > ESTAT | HALT | KBD | MEM | MOP | PSE | SCSI | TRIG } > START <addr> > TEST [/UTIL] <devnam | devnbr> > UNJAM > X <addr> <cnt> ... > ? > >>> B/1 > -DKA300 > SYSBOOT> SET/STARTUP OPA0: > SYSBOOT> SET WINDOWS_SYSTEM 0 > %SYSBOOT-E-NOPARAM, no such parameter WINDOWS_SYSTEM > SYSBOOT> SET WRITESYSPARAMS 0 > SYSBOOT> CONTINUE > VAX/VMS Version V5.5-2H4 Major version id = 1 Minor version id = 0 > PLEASE ENTER DATE AND TIME (DD-MMM-YYYY HH:MM) 27-NOV-2009 3:51 > $ > $ SPAWN > SPAWN > %DCL-S-SPAWNED, process SYSTEM_1 spawned > %DCL-S-ATTACHED, terminal now attached to process SYSTEM_1 > $ @SYS$SYSTEM:STARTUP > $! Copyright (c) 1993 Digital Equipment Corporation. All rights reserved. > %STDRV-I-STARTUP, VMS startup begun at 27-NOV-2009 04:00:59.19 > The VAX/VMS system is now executing the system startup procedure. > %SET-I-NEWAUDSRV, identification of new audit server process is 00000088 > The VAX/VMS system is now executing the site-specific startup commands. > %RUN-S-PROC_ID, identification of created process is 0000008C > %NCP-W-FILOPE, File open error , Permanent database > %NML-E-OPENOUT, error opening SYS$SYSROOT:[SYSEXE]NETLOGING.DAT; as output > -RMS-F-PLV, unsupported prolog version > %NCP-W-OPEFAI, Operation failure > %SYSTEM-F-TIMEOUT, device timeout > , timeout > , unit is active > , fatal hardware error > %NCP-W-UNRCMP, Unrecognized component , Circuit > Circuit = SVA-0 > %NCP-I-NOINFO, No information in database > %RUN-S-PROC_ID, identification of created process is 0000008D > Job NCPSTART (queue SYS$BATCH, entry 1) started on SYS$BATCH > %RUN-S-PROC_ID, identification of created process is 0000008F > %SET-I-INTSET, login interactive limit = 20, current interactive value = 1 > 27-NOV-2009 04:03:07 > Process SYSTEM_1 logged out at 27-NOV-2009 04:03:08.62 > Accounting information: > Buffered I/O count: 3431 Peak working set size: 888 > Direct I/O count: 1440 Peak page file size: 3806 > Page faults: 16606 Mounted volumes: 0 > Charged CPU time: 0 00:00:22.71 Elapsed time: 0 00:02:18.06 > %DCL-S-RETURNED, control returned to process STARTUP > $ SET DEFAULT SYS$SYSTEM > SET DEFAULT SYS$SYSTEM > $ RUN SYS$SYSTEM:AUTHORIZE > RUN SYS$SYSTEM:AUTHORIZE > UAF> MODIFY SYSTEM /PASSWORD=system > %UAF-I-MDFYMSG, user record(s) updated > UAF> EXIT > %UAF-I-DONEMSG, system authorization file modified > %UAF-I-RDBNOMODS, no modifications made to rights data base > $ LOGOUT > LOGOUT > SYSTEM job terminated at 27-NOV-2009 04:04:26.81 > Accounting information: > Buffered I/O count: 99 Peak working set size: 1056 > Direct I/O count: 46 Peak page file size: 3978 > Page faults: 471 Mounted volumes: 0 > Charged CPU time: 0 00:00:00.41 Elapsed time: 0 00:05:33.58 > Welcome to VAX/VMS V5.5-2H4 > Username:

27 November 2009 @ 03:03 · leo

Asterisk - permissions and ownership for the socket console

If you need to give asterisk operational permission to a simple user on linux system, first of all you can add it on asterisk group, then you can edit “asterisk.conf” usually on /etc/asterisk/ and give rwx permission to asterisk group like this (add if they don’t exist): [files] astctlpermissions => 770 astctlowner => asterisk astctlgroup => asterisk astctl => /var/run/asterisk/asterisk.ctl Restart asterisk to apply changes. Common error (wrong socket permission): [leo@srv01 ~]$ /usr/sbin/asterisk -r Asterisk 1.4.22-4 RPM by vc-rpms@voipconsulting.nl, Copyright (C) 1999 - 2008 Digium, Inc. and others. Created by Mark Spencer Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?) [leo@srv01 ~]$

10 November 2009 @ 06:18 · leo

Extract files from DEB package

Some day ago, I wrote about RPM extraction, today I need content of DEB packcage, on the contrary of rpm systems debian package manager allow to extract natively by this command: #dpkg-deb -x somepackage.i386.deb But my problem is different, I not using Debian sytem, fortunately DEB files are “ar” archives, which contain three files: debian-binary control.tar.gz data.tar.gz first, extract “ar” archive with this simple command: # ar vx somepackage.i386.deb then extract the contents of data.tar.gz using tar: ...

10 November 2009 @ 06:00 · leo

Mac OS X - Time Machine network backup without Time Capsule

From OS X 10.5 (Leopard) Apple introduced Time Machine: a great combination of rsync/rsnapshot and a beautiful user interface. Time Machine works in two modes: 1. local volume on local area or 2. Time Capsule over network. Now I don’t wanna buy another box with apple logo over it for much $$$ when I have a lot of file servers on my network. Now I explain a few hoops to get this system to work: ...

3 November 2009 @ 04:44 · leo

Extract files from RPM package

There is no direct RPM option available via rpm command to extract an RPM file. But there is a small utility available called rpm2cpio. It Extract cpio archive from RPM Package Manager (RPM) package. Example extract RPM file using rpm2cpio and cpio command: # rpm2cpio somepackage.x86_64.rpm | cpio -idmv Output of rpm2cpio piped to cpio command with following options: i: Restore archive d: Create leading directories where needed m: Retain previous file modification times when creating files v: Verbose

2 November 2009 @ 04:58 · leo