Archive

Archives pour 02/2024

Mcrypt : Installation

29/02/2024 Comments off

Vous devez compiler PHP avec l’option –with-mcrypt=[DIR] pour activer cette extension. DIR est le dossier d’installation de mcrypt. Assurez-vous de compiler libmcrypt avec l’option –disable-posix-threads .

Note, for Ubuntu, simply installing php5-mcrypt did not get mcrypt to work. You need to execute the following commands as root to enable it:

apt-get install php5-mcrypt
 mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
 php5enmod mcrypt
 service apache2 restart

If you don’t have a /etc/php5/conf.d directory, you can simply only do: php5enmod mcrypt

Should be working fine.

Categories: Système Tags: ,

How to enable alt+right click to resize window [duplicate]

29/02/2024 Comments off

Put this in a script and run it:

#!/bin/bash
gconftool-2 -s -t bool /apps/metacity/general/resize_with_right_button true
gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true

The gconftool-2 line is for GConf based systems, and gsettings is its newer replacement.

Categories: Système Tags: ,

Basic .htaccess for New Projects

28/02/2024 Comments off
# allows php on html
 AddType application/x-httpd-php .html
# Using this code, instead of having to type in http://mysite.com/contact.php, you only need to enter http://mysite.com/contact to access that page.
# And the best part is, you can still access the page with .php on the end of it, so no old incoming links or bookmarks become orphaned as a result of this, and everyone is happy.
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME}\.htm -f
 RewriteRule ^(.*)$ $1.htm
# gzip compression.
# html, txt, css, js, json, xml, htc:
 AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
 AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
 AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
# ------------------------
# CACHING to speed up site
# MONTH
 <FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$">
 Header set Cache-Control "max-age=2592000"
# WEEK
 <FilesMatch "\.(js|css|pdf|txt)$">
 Header set Cache-Control "max-age=604800"
# DAY
 <FilesMatch "\.(html|htm)$">
 Header set Cache-Control "max-age=43200"
# webfonts and svg:
 <FilesMatch "\.(ttf|otf|eot|svg)$" >
 SetOutputFilter DEFLATE
# use utf-8 encoding for anything served text/plain or text/html
 AddDefaultCharset utf-8
# force utf-8 for a number of file formats
 AddCharset utf-8 .html .css .js .xml .json .rss
# Custom 400 errors
 ErrorDocument 400 /error.php
# Custom 401 errors
 ErrorDocument 401 /error.php
# Custom 403 errors
 ErrorDocument 403 /error.php
# Custom 404 errors
 ErrorDocument 404 /error.php
# Custom 500 errors
 ErrorDocument 500 /error.php
# Changes http://example.com to http://www.example.com
 RewriteEngine on
 RewriteCond %{HTTP_HOST} !^www.your-domain.com$
 RewriteRule ^(.*)$ http://www.your-domain.com/$1 [R=301]
# Specifies what file will be the directory index
 DirectoryIndex index.php index.html index.htm
# Unhide the code below to turn on a Site Down Page
 # RewriteEngine On
 # RewriteBase /
 # RewriteCond %{REQUEST_URI} !^/your-domain\.php$
 # RewriteRule ^(.*)$ http://your-domain.com/site-down.php [R=307,L]
# redirect any variations of a specific character string to a specific address
 # RewriteEngine On
 # RewriteRule ^appsupport http://www.your-domain.com/ [R]
# ---- # The following will redirect to the new page permanently ----#
 # Redirect 301 /index.php http://www.your-domain.com/site-down.php
Categories: Système Tags: ,

A Standard .htaccess File with ExpressionEngine

28/02/2024 Comments off
.htaccess files can be a powerful tool for a developer, that is, as long as they are set up properly. What follows is a pretty simple .htaccess template that I use on the majority of my projects.

Secure .htaccess File

<Files .htaccess>
 order allow,deny
 deny from all
</Files>

This first set of lines essentially prevents others from viewing your htaccess file (and learning all about your crazy redirects).
Lire la suite…

Categories: Système Tags: ,

Quick Reference Guide For Linux Commands

27/02/2024 Comments off

Linux command shelf is a quick reference guide for all linux user who wish to learn linux commands. Commands are divided into 15 categories , which would be more easier to understand what commands to be used in specific requirement. The pdf format of linux command shelf is also available. You could reach Bobbin Zachariah the author of this guide for any comments or corrections.

You can download the latest version of linux command shelf in pdf format. Current linux command shelf version is 1.1. This guide can be used by both advanaced and new linux users , provided the best efforts to give most relevant linux commands.

You can navigate to each section using the index that is places on the right hand side of this page or just below. If you feel hard to understand any command please let me know on my above profile page.

1. SYSTEM

# uname –a                       # Display linux system information
# uname –r                       # Display kernel release information
# cat /etc/redhat_release        # Show which version of redhat installed
# uptime                         # Show how long the system has been running + load
# hostname                       # Show system host name
# hostname -i                    # Display the IP address of the host
# last reboot                    # Show system reboot history
# date                           # Show the current date and time
# cal                            # Show this month calendar
# w                              # Display who is online
# whoami                         # Who you are logged in as
# finger user                    # Display information about user
Categories: Système Tags: ,