Langsung ke konten utama

set timezone ubuntu, centos, debian

Set the timezone

To set the timezone of your system clock do the following:
cp /usr/share/zoneinfo/America/La_Paz /etc/localtime
Choose the right timezone for you.
Automatically adjust your computer clock
To have your system to automatically adjust time we need to install ntp. Get it from your repository. Once installed you can configure it this way:
Edit the file /etc/ntpd.conf. It will look like this:
# With the default settings below, ntpd will only synchronize your clock.
#
# For details, see:
# - the ntp.conf man page
# - http://support.ntp.org/bin/view/Support/GettingStarted
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon

# Associate to public NTP pool servers; see http://www.pool.ntp.org/
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

# Only allow read-only access from localhost
restrict default noquery nopeer
restrict 127.0.0.1
restrict ::1

# Location of drift and log files
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log

# NOTE: If you run dhcpcd and have lines like 'restrict' and 'fudge' appearing
# here, be sure to add '-Y -N' to the dhcpcd_ethX variables in /etc/conf.d/net
Be sure to start the daemon, and to make it start automatically when the system boots.
On Arch Linux is: /etc/rc.d/ntpd start on Debian and derivatives /etc/init.d/ntpd start
Update from the command line against a time server
You can update the clock manually, without the need of the daemon with ntpdate
ntpdate 129.6.15.28
You will get something like this:
19 Apr 15:45:23 ntpdate[10948]: step time server 129.6.15.28 offset -45.697084 sec

Komentar

Postingan populer dari blog ini

Tutorial Install SQLmap Ubuntu

sqlmap merupakan tools/alat opensource yang mendeteksi dan melakukan exploit pada Bug SQLinjection. dengan melakukan serangan SQL injection, peretas dapat mengambil alih hingga dapat memanipulasi sebuah database di dalam sebuah server. Sebelumnya, apa itu SQL Injection? SQL injection merupakan teknik hacking di mana peretas dapat menyisipkan perintah-perintah SQL melalu URL untuk di eksekusi oleh database. bug atau vulnerability ini terjadi karena kelalian seorang programer atau webmaster dalam melakukan pemograman web seperti tidak difilternya variabel dalam web tersebut. Cara installnya? $ sudo apt-get install git $ git clone https://github.com/sqlmapproject/sqlmap.git Untuk Menjalankannya, $ cd /patch/to/sqlmap/ jalankan dengan perintah dasar $ python sqlmap.py -h << untuk melihat basic options $ python sqlmap.py -u 'http://alamat.com'  contoh lain: $ python sqlmap.py --url=”http://192.168.152.129/dvwa/vulnerabilities/sqli/? id=1&Submit=S

PHP Apps in a Subdirectory in Nginx

 location /pilkades {     alias /var/www/html/pilkades;     try_files $uri $uri/ @nested;     location ~ \.php$ {         include snippets/fastcgi-php.conf;         fastcgi_param SCRIPT_FILENAME $request_filename;         fastcgi_pass unix:/run/php/php7.4-fpm.sock;     } } location @pilkades {     rewrite /pilkades/(.*)$ /pilkades/index.php?/$1 last; } atau: location /alias {     alias  /var/www/htmlalias;     location ~ /([^/]+\.php)$ {       try_files /$1 =404;       fastcgi_pass unix:/var/run/php5-fpm.sock;       fastcgi_index index.php;       include fastcgi_params;       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;     }   }

Backup Mysql ALL Database with Specific Methods ( #! /bin/bash)

#! /bin/bash # backup-mysql.sh # # Craig Sanders <cas@taz.net.au> # this script is in the public domain.  do whatever you want with it. MYUSER="root" MYPWD="PASSWD" ARGS="--single-transaction --flush-logs --complete-insert" DATABASES=$( mysql -D mysql --skip-column-names -B -e 'show databases;' | egrep -v 'information_schema' ); BACKUPDIR=/var/backups/mysql YEAR=$(date +"%Y") MONTH=$(date +"%m") DAY=$(date +"%d") DATE="$YEAR-$MONTH/$YEAR-$MONTH-$DAY" mkdir -p $BACKUPDIR/$DATE cd $BACKUPDIR/$DATE for i in $DATABASES ; do   echo -n "backing up $i: schema..."   mysqldump $ARGS --no-data -u$MYUSER -p$MYPWD $i > $i.schema.sql   echo -n "data..."   mysqldump $ARGS --skip-opt --no-create-db --no-create-info -u$MYUSER -p$MYPWD $i > $i.data.sql   echo -n "backup full databases"   mysqldump $ARGS -u$MYUSER -p$MYPWD $i > $i.full.sql   echo -n "Backup views"