terminal – wav to mp3

Mar, 23 -- Categories: Linux

lame -V2 inputfile.wav outputfile.mp3


butt_shareThis.addEventListener(MouseEvent.CLICK, butt_shareThis_CLICK);
function butt_shareThis_CLICK(e:MouseEvent):void {

// this line sends it to the standard alert box
navigateToURL(new URLRequest("javascript:alert('SHARE THIS Test');"), "_self");

// this line sends it console.log
navigateToURL(new URLRequest("javascript:console.log('SHARE THIS Test to console.log');"), "_self");

}

:focus {
-moz-outline-style: none;
}

and/or
a {
outline: none;
}

AS3 Timer

Mar, 15 -- Categories: Actionscript

// new Timer([interval], [repeat]);
var myTimer:Timer = new Timer(2000, 1);
myTimer.addEventListener(TimerEvent.TIMER, addDriverGrid);

myTimer.start();

function addDriverGrid(event:TimerEvent):void {
trace(“addDriverGrid()”);
}

Block access via htaccess

Mar, 11 -- Categories: Linux

order allow,deny
deny from 127.0.0.1
allow from all

This will refuse all GET and POST requests made by IP address 127.0.0.1, an error message is shown instead.

To block multiple IP addresses, list them one per line.

order allow,deny
deny from 127.0.0.1
deny from 127.0.0.2
deny from 127.0.0.3
allow from all

You can also block an entire IP block/range. Here we will not specify the last octet in the .htaccess file.

deny from 127.0.0

This will refuse access for any user with an address in the 127.0.0.0 to 127.0.0.255 range.

Instead of using numeric addresses, domain names (and subdomain names) can be used to ban users.

deny from isp_name.com

It bans users with a remote hostname ending in isp_name.com. This would stop all users connected to the internet via isp_name.com from viewing your site.

Using .htaccess to block an entire range or name is likely to lock out innocent users. Use with caution.

free an ip/host from fail2ban

Mar, 7 -- Categories: Linux

Check your rules
iptables -L

iptables -D your_jail -s your_ip_address -j DROP

iptables -D fail2ban-SSH -s 192.168.1.1 -j DROP

fail2ban – webmin filter

Mar, 6 -- Categories: Linux

[webmin-iptables]
enabled = true
filter = webmin-auth
action = iptables[name=webmin, port=10000, protocol=tcp]
sendmail-whois[name=WEBMIN, dest=example@example.com, sender=example@example.com]
logpath = /var/log/secure

Modify the two instances of example@example.com with the destination and sender email address. This jail will monitor attempted logins to the Webmin user interface, which runs on port 10000, and if there are to many, issue a ban on the IP address. The email address supplied in dest= will receive an email saying the ban as been issued. If you moved your install of Webmin to run on something other than port 10000, change the port= value as appropriate.

network install create/mount iso

Feb, 14 -- Categories: Linux

create iso from dvd:
dd if=/dev/dvd of=/var/www/html/centos/CENTOS5.iso

mount iso “into” an accessible directory
mount -o loop /var/www/html/centos/CENTOS5.iso /var/www/html/centos/src/

make an iso from a directory
mkisofs -o /path/to/directory.iso /path/to/directory/

AS-3 TextFieldAutoSize

Feb, 10 -- Categories: Actionscript

label_txt.autoSize = TextFieldAutoSize.NONE — The default. No resizing.

label_txt.autoSize = TextFieldAutoSize.LEFT — Will automatically resize the textfield and left-align the text.

label_txt.autoSize = TextFieldAutoSize.CENTER — Will automatically resize the textfield and center the text.

label_txt.autoSize = TextFieldAutoSize.RIGHT — Will automatically resize the textfield and right-align the text.

NOW=$(date +”%b-%d-%y-%H-%M”)

#back everything up
tar -czvf /home/user/archives/$NOW.tgz /home/user/htdocs
mysqldump –user=user –password=XXXXX –opt some_database > /home/user/archives/some_database.$NOW.sql

#get the new content
scp -r user@example.com:/home/vhosts/user/htdocs/* /home/remotefiles/htdocs
mysqldump -h remotedata.com –user=user –password=XXXXX somedatabase | mysql -h localhost –user=user –password=XXXXX some_database