Systemctl commands on fedora… sysvinit to systemd

thx to http://fedoraproject.org

sysvinit Command systemd Command Notes
service frobozz start systemctl start frobozz.service Used to start a service (not reboot persistent)
service frobozz stop systemctl stop frobozz.service Used to stop a service (not reboot persistent)
service frobozz restart systemctl restart frobozz.service Used to stop and then start a service
service frobozz reload systemctl reload frobozz.service When supported, reloads the config file without interrupting pending operations.
service frobozz condrestart systemctl condrestart frobozz.service Restarts if the service is already running.
service frobozz status systemctl status frobozz.service Tells whether a service is currently running.
ls /etc/rc.d/init.d/ systemctl list-unit-files –type=service (preferred)
ls /lib/systemd/system/*.service /etc/systemd/system/*.service
Used to list the services that can be started or stopped
Used to list all the services and other units
chkconfig frobozz on systemctl enable frobozz.service Turn the service on, for start at next boot, or other trigger.
chkconfig frobozz off systemctl disable frobozz.service Turn the service off for the next reboot, or any other trigger.
chkconfig frobozz systemctl is-enabled frobozz.service Used to check whether a service is configured to start or not in the current environment.
chkconfig –list systemctl list-unit-files –type=service (preferred)
ls /etc/systemd/system/*.wants/
Print a table of services that lists which runlevels each is configured on or off
chkconfig frobozz –list ls /etc/systemd/system/*.wants/frobozz.service Used to list what levels this service is configured on or off
chkconfig frobozz –add systemctl daemon-reload Used when you create a new service file or modify any configuration

More info…

http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet

Symfony 1.4 Fedora 16 Required Packages

[root@fedora ~]# yum -y -v install httpd php php-xml php-mbstring php-cli php-pecl-apc php-mysql php-pgsql php-process

Drupal 7 required packages on CentOS 6.2

php

php-gd

php-mbstring

php-php-xml #DOM extension

php-pgsql

php-mysql

Enabling XDMCP

root@windowz:~# vim /etc/gdm/custom.conf 

Ubuntu 10.04.04
# GDM custom config
[xdmcp]
Enable=true
DisplaysPerHost=2

[security]
DisallowTCP=false

Fedora 16
# GDM custom config
[xdmcp]
Enable=true
DisplaysPerHost=2

[security]
DisallowTCP=false

root@windowz:~# service gdm restart

Backup, Edit, and Restore MySQL Database on GNU/Linux

// Backup database
root@wintendo:~# mysqldump -u root -p database_name > database_name_original.mysql
// Edit tha database file
root@wintendo:~# cp -v database_name_original.mysql database_name_mod.mysql
// Use vi!!! :D
root@wintendo:~# vi database_name_mod.mysql
// Restore database
root@wintendo:~# mysql -u root -p
Enter password:Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9520
Server version: 5.1.41-3ubuntu12.10 (Ubuntu) O_o lol hahaha
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>
mysql> drop database database_name;

mysql> create database dabase_name default character set utf8;

mysql> grant all privileges on database_name.* to ‘database_user’@’localhost’ identified by ‘database_user_password’;

mysql> flush privileges;

mysql> quit;
// Restore modified database file
root@wintendo:~# mysql -u root -p database_name < database_name_mod.mysql

Moodle 2.2 Ubuntu Required Packages and crontab

Web Server / Mail

apache2
sendmail

PHP
php5
php5-cul
php5-pgsql or php5-mysql // Note that you need a database server!!!!
php5-gd
php5-intl
php5-xmlrpc

TeX Support Requiered Packages for Moodle 2.2 (PNG Images)
texlive
imagemagick
dvips

Crontab Configuration

root@wubuntu:~# crontab -u www-data -e
no crontab for www-data – using an empty one

Select an editor. To change later, run ‘select-editor’.
1. /bin/ed
2. /bin/nano <—- easiest
3. /usr/bin/vim.basic
4. /usr/bin/vim.tiny

Choose 1-4 [2]: 4

# m h dom mon dow command
*/15 * * * * /usr/bin/php /var/www/moodle/admin/cli/cron.php

crontab: installing new crontab

root@wubuntu:~#

 

#!/bin/bash
echo "Hello World"
echo "Testing Source Code language

How to install and configure Horde 4

aptitude install apache2 apache2-utils php-auth php-pear php5 php5-cli php5-common php5-imap php5-pgsql sendmail postgresql

pear channel-discover pear.horde.org

pear install horde/horde_role

pear run-scripts horde/horde_role

# /var/www/horde

pear install -a -B horde/webmail

pear install -a -B horde/webmail

root@webmail1:/var/www/horde/imp/config# cat backends.local.php
<?php
$servers['imap'] = array(
‘disabled’ => false,
‘name’ => ‘Your IMAP Server’,
‘hostspec’ => ‘imap.your-domain.com’,
‘hordeauth’ => false,
‘protocol’ => ‘imap’,
‘port’ => 993,
‘secure’ => ‘ssl’,
‘maildomain’ => ‘your-domain.com’,
‘quota’ => array(
‘driver’ => ‘imap’,
),
‘cache’ => false,
);

 

Merry Christmas and Happy New Year

Thx 2 everyone that sporadically visits this blog!

kolbi Grupo ICE – Internet n MMS

Internet

kolbi3g

http://m.google.com/

 

MMS

kolbi3g

http://mmsice/

Proxy: 10.184.202.24

Port 8080

TuYo Móvil – Internet n MMS

Internet

tm7datos

http://m.google.com/

Proxy: 10.186.181.5

Port: 3128

 

MMS

tm7mms

http://mmsc.tuyomovil.com:1981

Proxy: 10.186.181.5

Port 3128

PHP File Uploads

vi  /etc/php5/apache2/php.ini

;;;;;;;;;;;;;;;;;

; Data Handling ;
;;;;;;;;;;;;;;;;;

; Maximum size of POST data that PHP will accept.
; http://php.net/post-max-size
post_max_size = 100M

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

 

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 10M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20

 

Quick reference http://www.php.net/manual/en/ini.core.php#ini.memory-limit

Diagram drawing program

# yum -y -v install dia

info

http://live.gnome.org/Dia

Tested on fedora 16 KDE

Cheese equivalent for KDE – Kamoso equivalent for Gnome

KDE

# yum -y -v install kamoso

GNOME

# yum -y -v install cheese

Tested on fedora 16 KDE

Libreoffice on fedora 16 kde…

Remove koffice (Optional)

yum -y -v remove koffice-core koffice-libs koffice-kdchart

Install libreoffice

yum -y -v install libreoffice-base libreoffice-calc libreoffice-core libreoffice-draw libreoffice-impress libreoffice-writer libreoffice-math libreoffice-langpack-es

Forwarding sites with Apache…

<VirtualHost *:80>
ServerName antarktikos.wordpress.com
Redirect permanent / http://www.antarktikos.wordpress.com/
</VirtualHost>

Happy day!!!

Happy 3F Day!!!!

Drupal warning: date() – Fixed

Warning:

warning: date(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Chicago’ for ‘CST/-6.0/no DST’ instead in /htdocs/www3/modules/aggregator/aggregator.pages.inc on line 259.

2 Fix it!:

On Fedora edit this file: /etc/php.ini

On OpenBSD editi this file:  vim /etc/php-5.3.ini

And Add/Edit

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = “America/Chicago”

Thats it!

 

Reinstallin’ Apache2 under debs..

$ sudo apt-get remove --purge apache2 apache2-utils
$ sudo aptitude install apache2


Some SU syntax

$ sudo su - www-data -c "crontab -e"

PostgreSQL Server on Fedora

[root@antares ~]#  yum -y -v install postgresql-server postgresql

[root@antares ~]# service postgresql initdb

Initializing database:                                     [  OK  ]
[root@antares ~]# 
[root@antares ~]# service postgresql start
Starting postgresql (via systemctl):                       [  OK  ]
[root@antares ~]# su - postgres
-bash-4.2$ psql

Drupal 6.22 Notes

Fedora 15

Required Packages
# yum install -y -v httpd postgresql-server php php-gd php-pdo php-pgsql php-mbstring

How to configure a CISCO Router – DHCP using ip helper-address

Router>
Router>enable 
Router#configure terminal 
Router(config)#hostname R1
R1(config)#interface serial 0/0/0
R1(config-if)#ip address 10.0.0.1 255.255.255.252
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown 
R1(config-if)#exit
R1(config)#router ospf 2011
R1(config-router)#network 10.0.0.0 0.0.0.3 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#exit
R1(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.9
R1(config)#ip dhcp excluded-address 192.168.1.254
R1(config)#ip dhcp pool pool-dhcp1
R1(dhcp-config)#network 192.168.1.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.1.1
R1(dhcp-config)#dns-server 192.168.1.2
R1(dhcp-config)#exit
R1(config)#ip dhcp excluded-address 192.168.2.1 192.168.2.9
R1(config)#ip dhcp excluded-address 192.168.2.254
R1(config)#ip dhcp pool pool-dhcp2
R1(dhcp-config)#network 192.168.2.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.2.1
R1(dhcp-config)#dns-server 192.168.2.2
R1(dhcp-config)#exit
R1(config)#interface fastEthernet 0/1
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown

Router>enable
Router#configure terminal 
Router(config)#hostname R2
R2(config)#interface serial 0/0/0
R2(config-if)#ip address 10.0.0.2 255.255.255.252
R2(config-if)#no shutdown 
R2(config-if)#exit
R2(config)#router ospf 2011
R2(config-router)#network 10.0.0.0 0.0.0.3 area 0
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
R2(config-router)#exit
R2(config)#interface fastEthernet 0/1
R2(config-if)#ip address 192.168.2.1 255.255.255.0
R2(config-if)#ip helper-address 10.0.0.1
R2(config-if)#no shutdown

 

How to configure a CISCO Router – Basic DHCP

Router>
Router>enable 
Router#configure terminal 
Router(config)#hostname R1
R1(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.9
R1(config)#ip dhcp excluded-address 192.168.1.254
R1(config)#ip dhcp pool pool-dhcp1
R1(dhcp-config)#network 192.168.1.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.1.1
R1(dhcp-config)#dns-server 192.168.1.2
R1(dhcp-config)#exit
R1(config)#interface fastEthernet 0/1
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown

 

 

 

 

How to configure Router CISCO – Encapsulation PPP – PAP and CHAP Authentication


Router>
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#username R2 password cisco
R1(config)#username R3 password cisco
R1(config)#interface serial 0/0/1
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#ip address 194.3.2.1 255.255.255.252
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication pap
R1(config-if)#ppp pap sent-username R1 password cisco
R1(config)#interface serial 0/0/0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#ip address 204.3.2.1 255.255.255.252
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap
R1(config-if)#end
R1#copy running-config startup-config 

Router>
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#username R1 password cisco
R3(config)#interface serial 0/0/1
R3(config-if)#no shutdown
R3(config-if)#ip address 194.3.2.2 255.255.255.252
R3(config-if)#encapsulation ppp
R3(config-if)#ppp authentication pap
R3(config-if)#ppp pap sent-username R3 password cisco
R3(config-if)#end
R3#copy running-config startup-config 

Router>
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#username R1 password cisco
R2(config)#interface serial 0/0/0
R2(config-if)#no shutdown
R2(config-if)#ip address 204.3.2.2 255.255.255.252
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap
R2(config-if)#end
R2#copy running-config startup-config
Follow

Get every new post delivered to your Inbox.