Squid - Radius auth

In this example a squid installation will use RADIUS “squid_radius_auth” Squid RADIUS authentication helper to authenticate users. Get last version of squid radius auth helper at: http://www.squid-cache.org/contrib/squid_radius_auth/ Download: [leo@srv01 leo]# wget http://www.squid-cache.org/contrib/squid_radius_auth/squid_radius_auth-1.10.tar.gz Extract: [leo@srv01 leo]# tar -xvf squid_radius_auth-1.10.tar.gz Go to directory: [leo@srv01 leo]# cd squid_radius_auth-1.10 Compile: [leo@srv01 squid_radius_auth-1.10]# make gcc -O2 -Wall -g -c -o squid_rad_auth.o squid_rad_auth.c gcc -O2 -Wall -g -c md5.c gcc -O2 -Wall -g -c util.c gcc -g -o squid_radius_auth squid_rad_auth.o md5.o util.o Now the installation, for my needs, I wanna keep binary into /usr/lib/squid/ and configuration file into /etc/squid/ and I don’t wanna take man files then edit Make.inc like this: ...

15 March 2010 @ 02:16 · Updated: 30 June 2026 @ 03:28 · leo

PHP - Limit Array Results

$count = 0; foreach ($records as $record) { print $record; $count++; if ($count == 5) break; }

14 March 2010 @ 19:19 · Updated: 30 June 2026 @ 03:28 · leo

OpenVMS - Set Time

The command to reset the system time to 18-APR-2010 09:47 is: $ SET TIME=18-APR-2010:09:47 Note the colon between the date and the time specification. (This extra colon is a requirement resulting from the DCL parsing rules. Normally, there is a space between the date and time.) On OpenVMS VAX, once a year between January 1st and circa April 11th, or whenever a different SYS.EXE system image is bootstrapped, issue the command: ...

14 March 2010 @ 16:51 · Updated: 30 June 2026 @ 03:28 · leo

Nagios - Twitter alerts

This entry will cover how to send nagios alerts to twitter, in the examples to follow using curl. Firstly edit commands.cfg And add the two following line: define command { command_name notify-by-twitter command_line /usr/bin/curl --basic --user "twitteruser:twitterpassword" --data-ascii "status=[Nagios] $NOTIFICATIONTYPE$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" http://twitter.com/statuses/update.json } define command { command_name host-notify-by-twitter command_line /usr/bin/curl --basic --user "twitteruser:twitterpassword" --data-ascii "status=[Nagios] $HOSTSTATE$ alert for $HOSTNAME$" http://twitter.com/statuses/update.json } Now define a contact for this twitter service into: contacts.cfg ...

27 February 2010 @ 13:22 · Updated: 30 June 2026 @ 03:28 · leo

OpenVMS - Command line editing

DCL implements command line editing and recall, so that users can more easily correct typing errors and reuse previous command lines. Recall buffer: access to recently issued commands $ RECALL string Bring up last command beginning with string. $ RECALL/ALL Displays all commands and their numbers. $ RECALL number Use a number found in RECALL/ALL. Command line editing (if it isn’t on, do: $ SET TERM/LINE): $ {up-arrow} Previous command in recall buffer. $ {down-arrow} Next command in recall buffer. $ {Ctrl A} Toggle insert/overstrike editing. $ {Ctrl D} Move one character left. $ {Ctrl E} Move to the end of the line. $ {Ctrl F} Move one character right. $ {Ctrl H} Move to the beginning of the line. $ {Ctrl J} Delete word left of cursor. $ {Ctrl R} Rewrite the command line. $ {Ctrl U} Delete line left of cursor. $ {Ctrl X} Cancel the current command line. Miscellaneous: ...

24 February 2010 @ 17:35 · Updated: 30 June 2026 @ 03:28 · leo

MSTSC - Admin session

Memo per il Giaco: Syntax MSTSC option MSTSC /Edit"ConnectionFile" MSTSC /migrate Options ConnectionFile The name of an RDP file for connection /v: The remote computer to connect to /console Connect to the console of a server (NT/XP) /Admin Connect to a session for administering the server(Vista/2008) /f Start in Full Screen mode /w:width Width of the RDP screen /h:height Height of the RDP screen /span Match the Remote Desktop width and height with the local virtual desktop, spanning across multiple monitors if necessary.(Vista/2008) /public Run Remote Desktop in public mode. (Vista/2008) In public mode, passwords and bitmaps are not cached. /edit Open the RDP file for editing. /migrate Convert a legacy Client connection file into an .RDP file

19 February 2010 @ 14:56 · Updated: 30 June 2026 @ 03:28 · leo

Exim - Spool destroyer

In case of massive spam attack. #!/bin/bash ls /var/spool/exim/input/ > /tmp/delspoorexim declare -a ARRAY exec 10< /tmp/delspoorexim let count=0 while read dels <&10; do rm -fr /var/spool/exim/input/$dels echo $dels ARRAY[$count]=$dels ((count++)) done echo Number operation done: ${#ARRAY[@]} #echo ${ARRAY[@]} exec 10>&- rm /tmp/delspoorexim

17 February 2010 @ 14:10 · Updated: 30 June 2026 @ 03:28 · leo

OpenVMS - SYS$BATCH Queue

Little memo about sys$batch queue: If no queue manger set: $ DEFINE/SYSTEM/EXECUTIVE_MODE QMAN$MASTER DKA100:[QUEMAN] $ START/QUEUE/MANAGER DKA100:[SYSQUE] Problem: $ SHOW QUEUE SYS$BATCH %JBC-E-NOSUCHQUE, no such queue Resolution: $ INIT/QUE/BATCH SYS$BATCH Problem: $ SHOW QUEUE SYS$BATCH %JBC-E-JOBQUEDIS, system job queue manager is not running Resolution: $ START/QUE SYS$BATCH Full Reset: $ STOP/QUE SYS$BATCH $ DELETE/QUE SYS$BATCH $ INIT/QUE/BATCH SYS$BATCH More info: OpenVMS System Manager's Manual Chapter 13 Managing the Queue Manager and Queue Database `

11 February 2010 @ 10:41 · Updated: 30 June 2026 @ 03:28 · leo

Solaris - Add swap to ZFS disk

I installed Solaris 10 05/09 on a machine and I used whatever the default swap space setting when I built the box. Now I need to increase the swap space and I can’t add a swap file, like was possible under UFS. If your swap device is in use, then you might not be able to delete it. Check to see if the swap area is in use. For example: ...

11 February 2010 @ 09:38 · Updated: 30 June 2026 @ 03:28 · leo

DEC 3000 Alpha - Firmware Upgrade

>>> boot esa0 INIT-S-CPU... INIT-S-ASIC... INIT-S-MEM... INIT-S-NVR... INIT-S-CXT... INIT-S-SCC... INIT-S-NI... INIT-S-SCSI... INIT-S-ISDN... AUDIT_BOOT_STARTS ... AUDIT_BOOT_REQ AUDIT_BOOT_RETRY AUDIT_BOOT_RETRY AUDIT_BOOT_RETRY AUDIT_BOOT_RETRY AUDIT_BSERVER_FOUND AUDIT_LOAD_BEGINS AUDIT_LOAD_DONE *** FIRMWARE UPDATE UTILITY V2.6a *** *** SYSTEM TYPE: M300 *** UPDATE VERIFY LIST SHOW ? UPD-> update Read IO ROM Device ID UPD-I VERIFY LOADED ROM IMAGE ........................... UPD-I VERIFY LOADED ROM IMAGE DONE MANUFACTURER = INTEL (0x89) DEVICE CODE = 28F020 (0xbd) 256K x 8 Read System ROM Device ID UPD-I VERIFY LOADED ROM IMAGE ........................... UPD-I VERIFY LOADED ROM IMAGE DONE MANUFACTURER = INTEL (0x89) DEVICE CODE = 28F020 (0xbd) 256K x 8 UPDATE SYSTEM ROM DEVICE UPD-I VERIFY LOADED ROM IMAGE ........................... UPD-I VERIFY LOADED ROM IMAGE DONE FIRMWARE REVISION: V7.0 LENGTH: 0x352e4 -> 217828 BYTES CHECKSUM: 0x1c MANUFACTURER = INTEL (0x89) DEVICE CODE = 28F020 (0xbd) 256K x 8 UPD-I *** ROM CONTENTS WILL BE DESTROYED *** UPD-I ARE YOU READY TO PROGRAM DEVICE ? (Y/N ) y UPD-I PRECHARGING DEVICE ................................................................ UPD-I ERASING ROM DEVICE ................................................................ UPD-I PROGRAMMING DEVICE ..................................................... UPD-I PROGRAMMING COMPLETED ........................... SYSTEM ROM UPDATE SUCCESSFUL UPDATE IO ROM DEVICE UPD-I VERIFY LOADED ROM IMAGE ........................... UPD-I VERIFY LOADED ROM IMAGE DONE FIRMWARE REVISION: V7.0 LENGTH: 0x34da8 -> 216488 BYTES CHECKSUM: 0x59 MANUFACTURER = INTEL (0x89) DEVICE CODE = 28F020 (0xbd) 256K x 8 UPD-I PRECHARGING DEVICE ................................................................ UPD-I ERASING ROM DEVICE ................................................................ UPD-I PROGRAMMING DEVICE .................................................... UPD-I PROGRAMMING COMPLETED ........................... IO ROM UPDATE SUCCESSFUL UPD-> UPD-> ? UPDATE: Update the ROMs. Jumpers MUST be installed on both roms. For example UPD->update VERIFY [DEVICE]: Verify the ROM[s]. If no qualifiers then all ROMS verified The Checksum of file image is compared with rom image For example UPD->verify UPD->verify system UPD->verify io SHOW [DEVICE]: Show the current ROM Revision For example UPD->show UPD->show system UPD->show io LIST : List the supported ROM Devices For example UPD->list *** ROM Devices Supported *** SYSTEM: KN15-AA CPU Module 28F020 256Kx8 FLASH MEMORY IO: IO-XXX I/O Module 28F020 256Kx8 FLASH MEMORY *** FIRMWARE UPDATE UTILITY V2.6a *** *** SYSTEM TYPE: M300 *** UPDATE VERIFY LIST SHOW ? UPD->

11 February 2010 @ 09:16 · Updated: 30 June 2026 @ 03:28 · leo