CyberTek - the future at the present!
Google

Finding text with grep

Posted by: (Nov 2)

Here is a simple way to search for text in a series of files, valid for all linux distros:

grep "my search string" / home / MyHome / *. txt

the grep command can also add other options:

- Perform a recursive search in sub-directories:

grep-r "my text" / home / MyHome

- Print only the name of the file where we have Notre occurrence:

grep-H-R "My Test" / home / MyHome

Published in: linux , shell , tips

List installed packages in Ubuntu

Posted by: (Jun 17)

Reinstall all the packages that we used in our previous Ubuntu linux box (it also applies to Debian and the like) can be a long and then maybe it is not said that we remember everything we used to, especially if it is rich of facilities development libraries or installation servers. To reinstall all the packages on the new box, but we can do everything with a few simple commands.

To generate the list of packages installed in your ubuntu linux box:

  dpkg - get-selections> installed-software 

To verify and reinstall all the packages on your list, ubuntu linux box on the target:

  dpkg - set-selections <installed-software 

Finally, type the command

  dselect 

Published in: linux , tips , ubuntu

nano editor, keyboard shortcuts and alternatives

Posted by: (Tue 21)
The notation for the abbreviations is as follows. The sequences identified by the symbol (^) are introduced using the Control key (Ctrl), or by pressing the Esc key twice. The sequences identified by the symbol Meta (M) can be inserted using either the Esc, Alt or Meta, depending on the configuration of the keyboard. In addition, pressing Esc twice and typing the numbers from 000 to 255 characters can be entered with the corresponding ASCII code. The following abbreviations are available in the main editor window. The alternative sequences are shown in parentheses:

^ G (F1) Show this help message
^ X (F2) Close the current file / Exit nano
^ O (F3) Saves the current file on disk
^ J (F4) Justify the current paragraph

^ R (F5) Insert another file into the current
^ W (F6) Search for a string or regular expression
^ Y (F7) Go to the previous screen
^ V (F8) Go to the next screen

^ K (F9) Cut the current line and stores it in cutbuffer
^ U (F10) cutbuffer Paste from the current line
^ C (F11) Shows the location of the cursor
^ T (F12) Run the spell checker, if available

M-\ (M |) goes to the first line of the file
M / (M-?) Should be the last line of the file

^ _ (F13) (MG) goes to a line number and column-specific
^ \ (F14) (MR) Replaces a string or regular expression
^ ^ (F15) (MA) Make the text at the cursor position
MW (F16) Repeat the last search

M-^ (M-6) Copy the current line and stores it in cutbuffer
Apply M-indent to current line}
M-{Remove indentation from the current row
Advance one character ^ F
^ B Decreases the font
^ Space forward one word
M-Space Decreases the word
^ P Move to previous line
^ N Move to next line

^ Go to beginning of current line
^ E Move to end of line
M-((M-9) to the beginning of the paragraph, then the preceding paragraph
M-) (M-0) Go to the end of the paragraph, then the next paragraph
M-] Go to the corresponding parenthesis
M-(M-_) Scrolls up one line without moving the cursor
-M + (M-=) Scroll down one line without moving the cursor
M-<(M,) goes to the previous buffer
M-> (M-.) Go to next buffer

Inserts a character literally MV
^ I Insert a tab at the cursor position
^ M inserts a carriage return at the cursor position
^ D Delete the character under the cursor
^ H Delete the character to the left of the cursor
MT Cut from the cursor to the end of the file

MJ Justify the entire file
MD Count the number of words, lines and characters
^ L Refresh the current screen
^ Z suspends the editor (if hibernation is enabled)

(MX) Command bar enables / disables
(MC) Always show the position of the cursor enable / disable
(MO) Use one row for more changes enable / disable
(MS) Continuous Scrolling enables / disables
(MP) Show white space enables / disables
(MY) Syntax colored enables / disables
(MH) Smart Home key enables / disables
(MI) Auto Indentation enables / disables
(MK) Cut to end of line enables / disables
(ML) Wrap enables / disables
(MQ) Convert tabs to spaces enable / disable
(MB) File Backup enables / disables
(MF) Multiple files enable / disable
(MM) Mouse Support enable / disable
(MN) No format conversion from DOS / Mac enables / disables
(MZ) Suspension enable / disable
(M-$) Wrap soft enable / disable

Published in: linux , linux nano , shells , tips

Ubuntu VirtualMin + + Antispam / Antivirus Module

Posted by: (Tue 21)
To operate the engine antispam / antivirus + Webmin + Virtualmin Ubuntu distro must firstly install the wrapper for the procmail, this serve is not in the Ubuntu distro, but you can easily find online at the site of VirtualMin:

http://software.virtualmin.com/gpl/debian/dists/virtualmin-etch/main/binary-i386/

install the package with a simple: sudo dpkg-i-wrapper_1.0 procmail-2_i386.deb

Then you should check the permissions of the resi procmail-wrapper that you can find in / usr / bin:
rwsr-xr-x 1 root root 2.9K 11/28/2006 10:08 procmail-wrapper
actually it should already be ok after installation. In particular, if s does not appear in the user permissions you have problems.

Finally we check that postfix uses procmail our wrapper and not directly:

sudo nano / etc / postfix / main.cf

ensure that there is the following directive:

mailbox_command = / usr / bin / procmail-wrapper-o-a $ DOMAIN-d $ LOGNAME

Published in: linux , tips , ubuntu , virtualmin

Enable PCNTL form in php

Posted by: (Tue 14)

To enable support in php5 PCNTL (tested on Ubuntu 10.10) in the first place you need to install php5-cli php5-dev and, of course you must satisfy all the dependencies required by the system:

# Sudo apt-get install php5-dev php5-cli

After we have to put in the path where you can find the source of the module you want to fill:

# Cd / etc/php5/cli/php5-5.3.3/ext/pcntl

The path may be different, depending on the distro and version of php (/ etc/php5/cli/php5-xxxxx/ext/pcntl). But after we go to the final steps:

# Phpsize

#. / Configure

# Make

# Make install

Alternatively you can also make install to copy by hand the module you just compiled:

# Cp modules / pcntl.so / usr/lib/php5/shared_location_modules

Finally we add. Php ini to load our form to:

# Echo "extension = pcntl.so"> / etc/php5/conf.d/pcntl.ini

Do not forget to restart apache then to apply our changes:

# / Etc/init.d/apache2 restart

Published in: apache , development , php , tips , ubuntu

Bill vs. Steve

Posted by: (Jan 19)

A strange relationship that had developed over the years Bill Gates and Steve Jobs, summarized in this video we see the evolution, note also the aging of the characters. Bill in 1983 was a real nerd!

Published in: history , mac , microsoft

Increase ssh session length

Posted by: (Oct 5)

To prevent premature disconnection from a ssh session to reach a time limit of inactivity you can take the following steps:

1) A customer level, by modifying the file / etc / ssh / ssh_config, adding or changing the voice ServerAliveInterval, for example:

ServerAliveInterval 15

Set the retention time of the session to 15 minutes due to inactivity.

2) At the server level, edit the / etc / ssh / sshd_config, adding or changing entries and ClientAliveInterval ClientAliveCountMax, for example:

ClientAliveInterval 15
ClientAliveCountMax 15

The positions of the configs files may vary from one linux distribution to another, but usually the ones listed are the main paths, such as Debian, Ubuntu, Fedora, RH.

Published in: linux , shell , tips

Improve I / O performance of linux filesystem

Posted by: (Oct 4)

Improve the performance of I / O file system you can add the noatime mount the partition:

# Vi / etc / fstab

proc / proc proc defaults 0 0
none / dev / pts devpts gid = 5, mode = 620 0 0
/ Dev/md0 / boot ext3 defaults 0 0
/ Dev/md1 none swap sw 0 0
/ Dev/md2 / ext3 defaults, noatime 0 0

It is not necessary to restart the system to modify it to apply, bastarimontare the partition:

# Mount-o remount /

and then to display the parameters with which we put our partzione just type: +

# Mount

you should get a result like this:

/ Dev/md2 on / type ext3 (rw, noatime)
tmpfs on / lib / init / rw type tmpfs (rw, nosuid, mode = 0755)
proc on / proc type proc (rw, noexec, nosuid, nodev)
sysfs on / sys type sysfs (rw, noexec, nosuid, nodev)
procbususb on / proc / bus / usb type usbfs (rw)
udev on / dev type tmpfs (rw, mode = 0755)
tmpfs on / dev / shm type tmpfs (rw, nosuid, nodev)
devpts on / dev / pts type devpts (rw, noexec, nosuid ', gid = 5, mode = 620)
/ Dev/md0 on / boot type ext3 (rw)

Published in: Hacks & Mods , linux , tips

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)> list.txt

Published in: linux , shell , tips

Resume broken download with rsync

Posted by: (July 26)

Here is 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 above example 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

Download files from Megaupload, Rapidshare and other services from Linux, via prompt

Posted by: (July 22)

Try using the high quality Plowshare (a program command line) Enlarged to perform the upload and download some of the most popular file-sharing websites. It runs on Linux and Unix-like systems, supports: Megaupload, Rapidshare, 2Shared, 4Shared, zSHARE, Badongo, DepositFiles and Mediafire. In practice it is a replacement for wget for these sites.

Plowshare to install in Ubuntu Linux

1. If not satisfied, complied with the dependencies:

  sudo apt-get install curl imagemagick tesseract-ocr-recode eng SpiderMonkey-bin aview 


2. Plowshare Download , extract and install the content. There is also a version already packetized. Deb, if you use that version you just double-click the package and confirm the installation, vice versa:

  tar xvzf Plowshare-0.x 


3. Now let's set up Plowshare:

  Plowshare cd-0.x 
  sudo bash setup.sh install 

Commands Plowshare

Downloading a file from rapidshare:
plowdown http://www.rapidshare.com/files/86545320/Tux-Trainer_25-01-2008.rar

Na u download the list of files (one per line):
plowdown file_with_links.txt

Downloading a file from rapidshare with free membership ID:
plowdown-a myuser: mypassword http://www.megaupload.com/?d=132348234

Download a password-protected file from rapidshare:
p-plowdown somepassword http://www.megaupload.com/?d=ieo1g52v

Get only the URL file without downloading it Actually. Very handy if you want to use another downloader Web:
plowdown-link-only http://www.2shared.com/file/4446939/c9fd70d6/Test.html | xargs wget-rt

For advanced users: If you find a page with several links to files hosted on rapidshare you download it, to see the first 10 links, you must use the following command:
curl http://some-website.com/page.html | \
grep-o "http://www.megaupload.com/ [^ \" <] * "| uniq | head-n10 | plowdown -

To filter the links operating in a text file:
plowdown file_with_links.txt c-> file_with_active_links.txt

Upload a file on rapidshare with free membershipID:
plowup-a myuser: mypassword-d "My description" / path / myfile.txt megaupload

Upload a file on rapidshare with a premium multifetch ID and uploads:
plowup-a myuser: mypassword-d "My description"-multifetch http://www.somewherefarbeyond.com/somefile megaupload

Upload a file on rapidshare anonomamente, changing the file name after upload:
plowup / path / myfile.txt rapidshare: anothername.txt

Published in: linux , rapidshare , shell

Linux console with screen sharing

Posted by: (July 4)

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

1. Install Screen

sudo apt-get install screen
2. From the host computer is run by the parameter screen to start a session screen-S SessionName. -S allows you to specify a name for the session, this allows you to manage multiple user sessions simultaneously and in a lot easier.
screen-S screen-test

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

guest @ ssh remotehost
  5. The host computer (remotehost) consents to the connection in multi-user screen session by typing Ctrl-A: multiuser on (all 'command screen' 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 it to access the screen session with CTRL-A commadn: 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
Powered by CyberTek - Remote Assistance