CyberTek - the future at the present!

List the packages installed on Ubuntu / Debian

Posted by: (set 21)

For a list of software packages installed on your Linux machine (Ubuntu / Debian):

dpkg-l | awk '/ ^ ii / {print $ 2}' | grep-v-e ^-e-dev-lib and $ (uname-r)> lista.txt

Published in: linux , shell , tips

Resume broken download with rsync

Posted by: (July 26)

Here's an example of how to resume downloading a partially downloaded file via scp or rsync. Since scp does not support the resume, if siè started to download the file with this command, we still have to replace it with an alternative based on rsync:

rsync-partial-progress-rsh = "ssh-p 1022" root @ remotehost :/ ~ / filename filename

In the example above is also shown how to compose the command if you are using a port other than the traditional 22 for the SSH protocol.

Published in: linux , shell , tips

Share with Linux console screen

Posted by: (July 4)

With screen you can share among multiple users sonsole connected locally or via ssh. To do so, just follow these steps, the instructions are typical for a debian system, but likewise apply to other distributions.

1. Install screen

sudo apt-get install screen
2. From the host computer runs with the parameter screen to start a screen session SessionName-S. -S allows you to specify a name for the session, this allows you to manage multiple sessions and many users simultaneously in an easy manner.
screen-S screen-test

4. The remote user (guest) uses SSH to connect to remote computer (remotehost)

guest @ ssh remotehost
  5. The host (remotehost) consents to the connection in multi-user screen session by typing CTRL-A: multiuser on (all 'command screen' to start with the escape sequence Ctrl-A). 
CTRL-A: multiuser on

6. Then, the host (remotehost) must grant permission for the remote user (guest) to allow him access to the screen session with commadn CTRL-A: acladd user_name where user_name is the user's remote login.

CTRL-A: acladd guest

7. The remote user can connect to the host session. The syntax to connect to the screen session of another user is host_username screen-x / sessionname.

screen-x username / screen-test
Published in: HowTo , linux , shell , tips

How to format dates to display on a Linux shell

Posted by: (Apr 19)

In the shell you can specify the date format as follows:
date + FORMAT

For example, typing:
$ Date + "% m-% d-% y"

You get:
04-17-10

If you want the annoa 4 digits:
$ Date + "% m-% d-% y"

You get:
04-17-2010

In order to obtain the current time by typing:
$ Date + "% T"

You get:
19:55:04

In order to obtain the hour based on 12 hours:
$ Date + "% r"

You get:
07:56:05 PM

To view the time in HH: MM:
$ Date + "% H-% M"

You get:
07:56

Full list of options to format the dates wonder:

%%
a literal%
% To
Local's abbreviated weekday name (eg, Sun)
% A

Local's full weekday name (eg, Sunday)

% B
Local's abbreviated month name (eg, Jan)
% B
Local's full month name (eg, January)
% C
Local's date and time (eg, Wed 3 March 2005 23:05:25)
% C
century, like% Y, except omit last two digits (eg, 21)
% D
day of month (eg, 01)
% D

dates, exact as% m /% d /% y

% And
day of month, space padded; exact as% _d
% F
Full dates, exact as% Y-% m-% d
% G
last two digits of year of ISO week number (see% G)
% G
year of ISO week number (see% V); Normally useful only with% V
% H
Same as% b
% H

hour (00 .. 23)

% I
hour (01 .. 12)
% J
day of year (001 .. 366)
% K
hour (0 .. 23)
% S
hour (1 .. 12)
% M
month (01 .. 12)
% M

minute (00 .. 59)

% N
a newline
% N
nanoseconds (000000000 .. 999999999)
% W
Either the local's equivalent of AM or PM; blank if not known
% P
like% p, but lower case
% R
the local's 12-hour clock time (eg, 11:11:04 PM)
% R

24-hour hour and minute, exact as% H:% M

% S
seconds since 1970-01-01 00:00:00 UTC
% S
second (00 .. 60)
% T
Tabbed
% T
time; exact as% H:% M:% S
% U
day of week (1 .. 7), 1 is Monday
% U

Week number of year, with Sunday as first day of week (00 .. 53)

% V
ISO week number, with Monday as first day of week (01 .. 53)
% W
day of week (0 .. 6); 0 is Sunday
% W
Week number of year, with Monday as first day of week (00 .. 53)
% X
Local's date representation (eg, 31/12/99)
% X
Local's time representation (eg, 23:13:48)
% Y

last two digits of year (00 .. 99)

% Y
year
% Z
+ Hhmm numeric timezone (eg, -0400)
%: Z
+ Hh: mm numeric timezone (eg, -04: 00)
% :: Z
+ Hh: mm: ss numeric time zone (eg, -04: 00:00)
% ::: Z
numeric time zone with: to Necessary precision (eg, -04, +05:30)
% Z
alphabetic time zone abbreviation (eg, EDT)

Published in: linux , shell , tips

How to mount Windows share in Linux

Posted by: (Apr 19)

To view the active sharing of advice do before this command:

smbclient-L-U <windows-box> <username>

Then we can proceed to map the condivisionewindows in our linux box in segunete way:

  1. Create the directory for the mountpoint: mkdir / mnt / <name-of-mount-point>
  2. We mount the windows share share:
    mount-t cifs-o username = <username>, password = <password> / / <win-box> / <share> / mnt / <name-of-mountpoint>
    Note: The syntax-<username> username =, password = <password> saves the password.
  3. Finally, if you want you can drive to create the symbolic link: ln-s / mnt / <name-of-mount-point> / <path-of-symlink>

Published in: linux , samba , shell , tips

Moonlight on Linux to support SilverLight

Posted by: (Tue 18)

If you can not view the content of websites like www.rai.tv on your linux box `and` why these websites have videos and content developed for SilverLight. To solve our problem we encounter is Moonlight.

Moonlight is an open source implementation of Silverlight for Microsof t. Thanks to plug-in so you can `see the much longed-for content in your FireFox and above all you can do in your Linux Box.

Vederee went to try this link: http://www.go-mono.com/moonlight/

Published in: firefox , linux , microsoft , tips

Problem VirtualMin + spamassassin + procmail

Posted by: (Mon 2)

If Ubuntu Server after you install and configure webmin + VirtualMin there appears the error:

The procmail command procmail has 0 permissions, When It Should Be setuid and setgid to root. Email may not be properly delivered or checked for spam.

Can be resolved by following these steps:

  1. Verify that the configuration files of postfix / etc / postfix / main.cf contains the following line:
    mailbox_command = / usr / bin / procmail-a "$ EXTENSION"
    if it appears: mailbox_command = procmail-a "$ EXTENSION" should be amended with the absolute path as above.
  2. Change the group owner of / usr / bin / procmal from "mail" to "root". Chgrp root / usr / bin / procmail
  3. Finally, set the following permissions on the executable procmail: chmod 6755 / usr / bin / procmail

Here are some links from which to take inspiration for most cases, but in my case these three steps have solved the problem, tested on Ubuntu Server 10.04 and 10.10.

https://www.virtualmin.com/node/9426

http://www.virtualmin.com/node/8790

Published in: linux , tips , ubuntu , www

NANO editor, syntax highlight

Posted by: (Feb 22)

To add syntax coloring to nano in the first instance you must create the configuration file. Nanorc on their home page, as a second finding from this address: http://code.google.com/p/nanosyntax/source/browse/ # svn / trunk / syntax-nanorc files. nanorc be included in the configuration to achieve the desired effect.

Example text to be added to. Nanorc:

include "/ usr / share / nano / php.nanorc"
include "/ usr / share / nano / sh.nanorc"
include "/ usr / share / nano / java.nanorc"
include "/ usr / share / nano / patch.nanorc"
include "/ usr / share / nano / python.nanorc"
include "/ usr / share / nano / html.nanorc"
include "/ usr / share / nano / perl.nanorc"
include "/ usr / share / nano / ruby.nanorc"
include "/ usr / share / nano / js.nanorc"

Published in: linux , shell , tips

Shorcuts from bash

Posted by: (Oct 19)

Ctrl + A Go to the top of the line you are typing.
Ctrl + E Go to the end of the line you are typing.
Ctrl + L Clear the screen.
Ctrl + U Clears the screen before the cursor. If you are at the end of the line, clears the entire line.
Ctrl + R allows you to search through previously used commands.
Ctrl + C Stop whatever you are doing.
Ctrl + D Exit the current shell.
Ctrl + Z starts the suspension in the background whatever you are doing.
Ctrl + W Delete the word before the cursor is.
Ctrl + K Clear the line after the cursor.
Ctrl + T Reverses the last two characters before the cursor.
Esc + T Swap the last two words before the cursor.
Alt + F Move cursor forward one word in the current row.
Alt + B Move cursor back one word in the current row.
Tab Auto-Complete the names of files and folders.
Paste Ctrl + Y (as in copy and paste) all the text before the cursor.

Note: Some of these commands do not work if shell access is via telnet, or SSH session if the keyboard is a particular configuratain

Published in: linux , shell , tips

Sendmail saslauthd authentication

Posted by: (set 24)

For all those who have a Linux server with Sendmail service is now necessary to grant the possibility of transmission through authentication. Indeed it is quite easy to activate the option, although you should be aware that some distributions like CentOS does not make it available by default, here is how to fix it:

Install the sendmail-cf package cyrus-sasl if not present in the system, for redhat / centos:

[] Yum install sendmail-cf cyrus-sasl

Then edit the sedmail.mc (/ etc / mail / sendmail.mc) and uncomment these lines:

define (`confAUTH_OPTIONS ',` A') dnl
TRUST_AUTH_MECH (`LOGIN PLAIN ') dnl
define (`confAUTH_MECHANISMS ',` LOGIN PLAIN') dnl

For safety check anchequesta setting:

DAEMON_OPTIONS (`Port = smtp, Addr = 0.0.0.0, Name = MTA ') dnl

At this point you need to recompile the sendmail.cf file with m4 program:

[] M4 / etc / mail / sendmail.mc> / etc / mail / sendmail.cf

Check and if necessary, edit the file / usr/lib/sasl2/Sendmail.conf as follows:

pwcheck_method: saslauthd

Now restart your sendmail and saslauthd

[] / Etc / init.d / saslauthd start

[] / Etc / init.d / sendmail restart

Finally we check that our work has been corrected:

[] Telnet localhost 25  

Trying 127.0.0.1 ...
Connected to localhost.
Escape character is '^]'.
220 ESMTP Sendmail 8.12.11/8.12.11 xxxxx.xxxxx.xx; Mon, 23 Aug 2004 12:36:30 +0200

As we introduce sendmail responds by typing:

ehlo localhost

which will be answered if all goes well (red line that tells us that sendmail accepts authentication, in addition to plain login may be other methods, it is correct):

250-xxxxx.xxxxx.xx xxxxx.xxxxx.xx Hello [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-AUTH PLAIN LOGIN
250-DELIVERBY
250 HELP

Published in: linux , redhat , tips

filters for Cisco Router

Posted by: (May 29)

Filter on our cisco router the right doors to protect our servers is certainly an indispensable duty. In the example below reporting filter as the only ssh port:

  • the console enter the command:
  • enable
  • Then enter your password.
  • now be able to give a look at your configuration with the command:
  • show running-config
  • take vision of the interfaces you want to filter (in our example will be a serial)
  • hours give the command:
  • config ends
  • Following the commands necessary to make an access list called 101 minimal but functional:
  • access-list 101 permit tcp any any established businesses
  • access-list 101 deny tcp 212.69.128.0 0.0.0.255 any eq 22 log
  • access-list 101 permit ip any any
  • our access list that is pretty ready. now we must go to our interface:
  • interface serial1/1.1
  • and then activate the desired access list with the following command:
  • ip access-group 101 in
  • voila, you're done, provided, that if you did something wrong will not go to even a package, you can always restart the router. If everything goes well then you just need to give the comand:
  • write
  • ctrl + z
  • prorpio and if you want before you leave you can take a look at the statistics of the access list:
  • show access-list

To get to this nutshell you must pass to wider horizons, to this link you can find the know-how which I fed to filter the cisco router at least part of what you should.

Published in: cisco , tips

Protect Apache websites

Posted by: (Apr 20)

ModSecurity ModSecurity is an Apache module that allows your truly effective ways to increase the defenses from malicious attackers.

This real firewall for apache is recoverable:

http://www.modsecurity.org/download/index.html

The module is very rich and willing to be honest alquantocomplicato to implement, but for this to lift a massive barrier against the aggressors of our websites, please refer to the documentation for the correct setting.

Updated filters can be found at: http://downloads.prometheus-group.com/delayed/rules/

Published in: apache , linux , tech
Powered by CyberTek - Remote Support