Jump to content

sleed

Active Members
  • Posts

    1019
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by sleed

  1. Hi there.I post essentialy 30 commands , that are used by everyone who work with linux :

    clear

    This is the command to clear screen. When you work with Linux you have a great amount of possibility of trying loads of commands. This means you need to clean up the screen time and again so that you could focus on your desired job. In order to clear the mess you need the command of clear wherein you simply have to type ‘clear’ over the command prompt to see things clean over your screen. This command is also useful when you have to type long commands, which can confuse the users to see different details over the screen.

    ls

    Shows list of files and directories.

    This is probably one of the most commonly typed commands. This has many options to see different types of files and it also supports wild cards.

    Show all files in current directory

    ls

    Show all files in a directory /mydir/some/path

    ls /mydir/some/path

    Display details of all file in the list

    ls -l

    Display all hidden files as well (including the files name start with a do )

    ls -a

    Display all file that have names starting with my

    ls my*

    cd

    Used to change directory

    Go to the home directory of logged in user

    cd

    Go to a specific directory named /mydir/some/path

    cd /mydire/some/path

    cp

    Copy a file or directory from one location to another.

    Copy a file name file1 with name file2

    cp file1 file2

    Copy the directory name dir1 to dir2

    cp -r dir1 dir2

    mkdir

    Create one or more directories

    Create a directory named mydirecory

    mkdir mydirectory

    Create 3 directories name dir1, dir2 and dir3

    mkdir dir1 dir2 dir3

    man

    Used to read more details about how to use any command

    There are hundreds of commands and each of these commands are supported with dozens of options. You can always use this command to explore more options supported by a command.

    Show help for ls command

    man ls

    Show help for grep command

    man grep

    mv - Rename command

    Used for renaming a file or directory.

    Rename file1 to file2

    mv file1 file2

    System Information

    date

    The command to see current date or set system date/time

    In order to type the date in two digit month formats, two digit time formats, two digit date, two digit minutes, you need this command. This will in changing and setting the date and time over your Linux based computer. This command is very much useful when you want to log on being a root.

    Display current date

    date

    Set current system date to "June 20, 1985, 5:27 PM"

    date 0620172785

    df

    The command for checking available disc space

    The computer users are often known to check the availability and consumed memory space over their systems for both the Linux and Windows desktop PCs. You can easily check the amount of memory available over the disk at your Linux system by simply typing the command of DF. It helps in offering you the status of file system disk space over your Linux based system.

    df -h

    du

    Display disk space use by each file in the file system

    Display disk usage by each file in Documents directory

    du -h Documents

    Display disk usage by the whole Documents direcotry

    du – sh Documents

    top

    Display the top running processes on the system with memory and cpu utilization.

    Display all top running processes

    top

    Display all top running processes from user fromdev

    top -U fromdev

    ps

    Show the status of running processes

    Display all running process status for current user

    ps

    Display the list of all running processes on system with their status.

    ps -al

    uname

    Find information about version and details of operating system

    uname -a

    File Operations

    gzip

    This command will compress a file in gzip format.

    gzip file1

    gunzip

    Uncompress the gzip file.

    gunzip file1.gz

    tail

    Display last few lines contents of a file. Very useful to watch latest content updates on log file.

    Watch running content of a logfile name logfile1

    tail -f logfile1

    Display last 100 lines of a file name myfile

    tail -100 myfile

    scp

    Copy a file to or from a remote host

    Copy the file "myfile.txt" from a remote host to the local host

    scp your_username@remote-server:foobar.txt /path/to/local/directory

    Copy a local file myfile.txt to remote server

    scp myfile.txt your_username@remote-server:/path/to/copy/

    Copy the directory "mydir" from the local host to a remote host's directory "myremotedir"

    scp -r mydir your_username@remote-server:/path/to/remote/directory/myremotedir

    sftp

    This can be used for doing file transfer using secure ftp protocol. To open a sftp command prompt on a sftp server try this

    sftp your_username@remote-server

    cat

    Used to display the content of the file on console without opening it in a editor..

    cat myfile

    more

    Used to display the content of a file on console with option to navigate in case the content is too large to fit in screen.

    more myfile

    find

    Find a file or directory on the system using this command

    Find a file myfile.txt in current directory and its subdirectories.

    find . -name “myfile.txt”

    Find all files in Documents directory that are larger that 25MB in size

    find . -size +25M -exec du -h {} \;

    Find all .doc files on the system that have been modified in the last 5 days.

    find . –name “*.doc” –mtime -5

    Find all .txt files on the system that were modified in last 15 minutes

    find . –name “*.txt” –mmin -15

    Find all files that contain a string “I am inside file”.

    find . -name "*" -exec grep -i -H "I am inside file" {} \;

    grep

    This command is used to search all the lines in all files in a specified location containing a string.

    Search for a specific string “myname” in a file myfile.txt

    grep “myname” myfile.txt

    Search for a specific string “myname” with ignoring the case in a file myfile.txt

    grep -i “myname” myfile.txt

    Search for a specific string “myname” in a all files in current directory

    grep “myname” *

    Search for full word “myword” in a file myfile.txt

    grep -w “myword” myfile.txt

    Search a string “myname” in all files in all subdirectories recursively

    grep -r “myname” *

    rm

    Remove a file or directory using this command

    Remove a file name myfile.txt

    rm myfile.txt

    Remove a directory mydir

    rm -r mydir

    Remove a file myfile.txt forcefully

    rm -f myfile.txt

    chmod

    The command for manipulating the file permissions

    For better security, the permissions for file in Linux OS are categorized into different groups, users and other sections. You have the option of controlling the permissions by assigning the users under the given divisions via the command of ‘chmod’. These permissions would help the users to write, read and execute the respective files. This option is very much handy when you have to run a script in order to install the package, which remains non executable in the default for security reasons. With the command of ‘chmod +x’ you could end up making the script executable over your Linux system.

    Provide execute permission on a file myfile.txt to all users

    chmod +x myfile.txt

    Provide read permission on a file myfile.txt to all users

    chmod +r myfile.txt

    Provide full permissions (read/write/execute) on a file myfile.txt to yourself but everyone else has only read and execute

    chmod 755 myfile.txt

    Provide full permissions (read/write/execute) on a file myfile.txt to everyone

    chmod 777 myfile.txt

    chown

    Change ownership of a file. You should be either root or the owner of the file to successfully run this command.

    Change the ownership of a file myfile.txt to another_user who is part of another_group

    chown another_user:another_group myfile.txt

    Change the ownership of a directory mydir1 recursively to another_user who is part of another_group

    chown -R another_user:another_group mydir1

    Other Useful Commands

    passwd

    This is the command for changing the password. Passwords play an important role in securing your data found in your desktop computer. In order to keep the system full proof against the hacking attacks, you need to keep on changing your passwords every three months. The users over Linux computers could do the same using a particular command of ‘change password’ over the command prompt and do the needful. After you type the command, all you need to do is to type the new password twice, and you are done with the same.

    logout

    Command for logging out. By typing this command, you would be logged out from your Linux based computer. This command will help in disconnecting from your Linux based PCs or simply help in logging out the session that you are seen over your desktop. All you need to do is to remember the account you have logged out as it may bring a couple of security issues. Hence it is highly suggested to use a log out the moment you finish your task over your PC.

    kill -9

    The command to terminate the process by its process id. You may find certain Linux applications not responding at such junctures, you could simply get away from this scenario by typing the kill command, which will help in terminating the process. For this you need the process ‘PID’ of the particular application, which could be done with the help of “ps” command. You could further use this command to kill the command to terminate the application, which is not responding.

    Terminate a process with with ID 1234

    kill -9 1234

    ”>” - The operator to redirect output

    Though this may not be called as a command by many yet it is among the important steps to master while you start working with Linux over the command line. For this you need several tools, which also include the pipe. These help in redirecting the output (that is often printed over the screen) somewhere else like the text file or any other application. This command is used to complete any file over the Linux system.

    Copy content of file1 to file2

    cat file1 > file2

    Append content of file1 to file2

    cat file1>>file2

    Create a new file myfile.txt with text “some text”

    echo “some text” > myfile.txt

    pipe (|) operator

    The pipe operator is a powerful operator that can be used to join two commands together. Usign this operator output of one command can become input to another command. For example

    Display live occurrence of text “myname” in a file myfile.log

    tail -f myfile.logs | grep “myname”

    Count the number of lines in a file myfile1

    cat myfile1 | wc -l

    Find all running java processes on a system

    ps -aef | grep “java”

    Find all .txt files containing text “myname”

    find . -name “*.txt” | xargs grep “myname”

    history

    This is the command for recall.

    You need to use history to rerun any command. If you enter this command without any kind of switch, you end up getting the history list along with the line numbers. Also, you could even perform some additional search of the given history list with this command.

    exit

    Use this to quit the command line shell on a linux system.

    Tutorial by sleed, from RST.

  2. Buna , in acest tutorial va v-oi arata cum sa instalati un server de sms pentru Linux. [Debian,Ubuntu only!]

    Avem nevoie de un telefon , putin mai vechi , eu am folosit un Nokia 6610i.

    Trebuie sa ne asiguram ca avem instalat toate modulele acestea :

    apt-get install apache2 libapache2-mod-php5 mysql-server php5 php5-cli php5-cgi php-pear php-db phpmyadmin make gcc sendmail sendmail-bin lynx wget curl

    Ca sa instalam ,modulul de serviciu , ne trebuie sa facem urmatoarele:

    adduser playsms

    mkdir -p /var/www/playsms

    mkdir -p /var/spool/playsms

    mkdir -p /var/log/playsms

    chown -R www-data /var/www/playsms

    chown -R www-data /var/spool/playsms

    chown -R www-data /var/log/playsms

    Download ->

    wget http://downloads.sourceforge.net/project/playsms/playsms/Version%200.9.7.2/playsms-0.9.7.2.tar.gz

    tar -zxvf playsms-0.9.7.2.tar.gz
    il dezarhivan cu comanda aceasta ,

    Intram aici :

    ../playsms-0.9.7.2/web

    Il adaugam la serverul nostru , in cazul asta , eu folosesc apache2, // .

    cp -rR * /var/www/playsms
    , apoi
    chown -R www-data /var/www/playsms
    .

    Facem o baza de date pe care o numim : playsms , sau cum vreti dumneavoastra , apoi ii dam import daca folosim phpmyadmin , la :

    db/playsms.sql
    .

    Next configuram PLaysms :

    cd /var/www/playsms
    , -> ,
    cp config-dist.php config.php
    ,

    --->

    nano config.php

    Schimbam Pass , si/sau numele la db , daca este cazul , si nu ati pus playsms , ca mai sus .

    Intram in :

    cd playsms-0.9.7.2/bin

    Efectuam aceste comenzi :

    cp playsmsd playsmsd.php playsmsd_star
    &
    cp playsms /etc/default/

    Intram aici :

    nano /etc/init.d/rc.local

    Adaugam aceasta linie , inainte de exit :

    /usr/local/bin/playsmsd_start
    , sa porneasca serviciul , cand aprindem pc-ul de fiecare data.

    Instalam SMS Tools :

    cd

    wget http://smstools3.kekekasvi.com/packages/smstools3-3.1.15.tar.gz

    tar -zxvf smstools3-3.1.15.tar.gz -C /usr/local/src

    cd /usr/local/src/smstools3

    make

    make install

    cd /usr/local/src/playsms-0.9.7.2

    cp contrib/smstools/smsd.conf /etc/

    nano /etc/smsd.conf
    si cautam la linia 27 , mie imi da asa : device = /dev/ttyUSB0, voi inlocuiti cu ce scrie la usb , sa functioneze corect.

    Apoi ii dam un run la aceste comenzi :

    mkdir -p /var/spool/sms/checked

    mkdir -p /var/spool/sms/failed

    mkdir -p /var/spool/sms/incoming

    mkdir -p /var/spool/sms/outgoing

    mkdir -p /var/spool/sms/sent

    mkdir -p /var/log/sms

    chown -R www-data /var/spool/sms

    update-rc.d sms3 defaults

    Si intram la : http://localhost/playsms , ne logam cu pass & user : admin : admin . Se poate trimite mai multe mesaje de pe acelasi numar , doar daca faceti un user nou , cu acelasi numar de telefon.Daca sunt probleme P.M.!

    Tutorial made by sleed from RSTFORUMS.COM

    Va multumesc ! :*

    • Upvote 2
  3. Noroc. Frumoasa idea, sper sa mai fie mai multi cu idei de astea , ca sunt prea putine despre IT in Romania , si mai putine de calitate. Ai de lucru mult cei drept , fa-ti un team , si apuca te de treaba. Fa-ti si publicitate , si da i bataie.Ce sa zic bafta.

  4. My objective is to show how to dual boot Kali Linux and windows 7 , at same time. Later i will present a tutorial that i show you how to dual boot windows 7 and debian server :) Ok. Let's go to do this.

    To bypass Kali Linux’s boot menu, simply edit the file named /etc/default/grub and change GRUB_TIMEOUT=5 to GRUB_TIMEOUT=0. Then run the update-grub command.

    1. Shrink the Windows 7 C Drive: My test system has an existing installation of Windows 7 on a 500 GB HDD, with just two primary partitions. This is how they appear in Windows 7?s partition manager. The task here is to shrink the C drive to create room for installing Kali Linux. To do that, right-click on the C drive and select Shrink Volume.

    Note: If you intend to install Windows 7 afresh, this process will be a lot easier if you set aside the free space that will be used for Kali Linux during the installation of Windows 7.

    If you have enough free space on the C drive, the system will suggest a 50-50 split of the free space. Which is just good enough for this test installation. Shrink.

    After the operation has completed, you should see the newly reclaimed space next to the C drive. You may exit the partition manager and reboot the computer. Be sure to have the installation disc of Kali Linux in the optical drive before rebooting.

    2. Install Kali Linux: The best option to select on Kali Linux’s boot menu is Graphical Install. It gives you a point-and-click installation process. Install works just as well, but the interface is ncurses-based.

    For installing Kali Linux, the following partitions will be created: /boot, /, /home, and Swap. In that order. The /home partition is optional. At the disk partitioning methods step of the installation process, you get a bunch of options. Because none of the guided options will create a separate /boot partition, creating the partitions will have to be done manually. So select “Manual” and click Continue.

    Here you can see the existing Windows 7 partitions, both of which are primary partitions. The free space, reclaimed from Windows 7 in the previous step is what will be used for creating the partitions for Kali Linux. To start creating the partitions, select the free space and click Continue.

    Create a new partition. Continue.

    This shows the total amount of disk space available for Kali Linux. The /boot partition will be created first, so you need to specify the amount of disk space for it.

    For this test system, I assigned 300 MB to it. Continue.

    Because you still have two primary partitions to use, you can create the boot partition as a primary or logical partition. Either option will work, but the installer prefers creating it as a primary partition, if the boot loader is going to be installed in it. For this test installation, I chose to create it as a logical partition. Continue.

    Beginning. Continue.

    This step shows the details of the boot partition you just created. The only thing you need to change here is the mount point. Double-clicking on it will open another window where you can specify the correct mount point.

    Here’s what it should look like after the mount point has been specified. The other option you might want to change here is the Bootable flag.

    There is a good reason it should be enabled, but the system will boot even if it is disabled. It just depends on your BIOS version. For this test installation, it was disabled and the system still worked perfectly.

    Here’s the final details of the boot partition. Scroll to “Done setting up the partition,” then click Continue. Note that the steps you used to create the boot partition will be repeated for the other partitions.

    Back to the main disk partitioning window, you can see the boot partition you just created, plus the remaining free space. Select, the free space, then click Continue.

    The next partition will be mounted at /. A new installation of Kali Linux takes up about 6.4 GB of disk space, so any amount greater than that will do. For the test installation, I gave it 60 GB, which is way too much, so you do not have to do the same. About 10-12 GB is more than enough. Continue.

    Here are the details of the new partition. Scroll to “Done setting up the partition,” then click Continue.

    For the home partition, I gave it a disk space of 100 GB. Continue.

    Here are the details of the new partition. Scroll to “Done setting up the partition,” then click Continue.

    For Swap, 2 GB is good enough. Continue.

    Here are the default details of the new partition. To specify that it be used as a Swap partition, double-click the “Use as” line.

    Then select “swap area.” Continue.

    Scroll to “Done setting up the partition,” then click Continue.

    With all the partitions created, scroll to “Finish partitioning and write changes to disk.” Continue. Make note of the device number of the boot partition. Here, it is sda5. You’ll need it later.

    Select “Yes.” Continue.

    By default, the installer will want to install GRUB, the boot loader, in the Master Boot Record (MBR). However, for setting up this dual-boot system, we want GRUB in the boot partition. So, select “No.” Continue.

    his is where you have to specify where GRUB should be installed. For this test system, it is /dev/sda5. Continue.

    After installation, the computer will reboot into Windows 7. The next task involves add an entry for Kali Linux in Windows 7?s boot menu.

    3. Add Kali Linux to Windows 7?s boot menu: The simplest graphical application for modifying the Boot Configuration Data of Window that I know, is EasyBCD. It is free for personal use. You may download it from here. Install it as you would any other Windows application. The main window is shown below. To add an entry for Kali Linux in the boot menu, click on the Add New Entry tab.

    Then click on the Linux/BSD tab. From the Type dropdown menu, select GRUB 2. Modify the name field to reflect the name of the distribution you are adding. From the Drive menu, you can either select the specific partition corresponding to the boot partition of the Kali Linux installation or let EasyBCD automatically locate and load it. Either one will work. Note that EasyBCD’s drive numbers and the device numbers of the Linux partitions do not match. For example, in this test installation, the boot partition is /dev/sda5, but the corresponding drive number in EasyBCD is Partition 3. The size of the partition helps to determine which one it is. Click the Add Entry button when wll the options have been specified.

    From the Edit Boot Menu tab, you can see a preview of the entries that will appear in the Windows 7 boot menu. Exit EasyBCD and reboot the computer.

    Sursa: Dual-boot Windows 7 and Kali Linux | LinuxBSDos.com

    That's all fox

  5. Noul Cod Penal a intrat în vigoare azi-noapte la ora 00:00. 400 de de?inu?i ar putea fi elibera?i în baza noului Cod. 200 dintre ei au depus deja cereri la ANP.

    Noul cod de procedur? penal? prevede mic?orarea drastic? a unor pedepse.

    Spre exemplu furtul ?i în?el?ciunea care, pân? acum erau pedepsite cu maximum 12 ani. Vor fi încadrate pân? la trei ani de închisoare. Pedeapsa pentru în?el?ciune cu consecin?e deosebit de grave scade pentru cei g?si?i vinova?i de la 20 de ani la o pedeaps? între 1 ?i 5 ani.

    Prin urmare, cei care acum sunt condamna?i la peste maximum prev?zut de noua lege pentru astfel de fapte vor fi liberi printr-o simpl? cerere c?tre instan?a de judecat? întocmit? de comisii speciale din fiecare penitenciar.

    Pedepsele cu executare vor avea alternative. Una dintre ele este renun?area la pedeaps?. Ar mai fi suspendarea execut?rii sub supraveghere. O alt noutate este no?iunea zilelor-amend?. Adic?, dac? un condamnat prime?te o pedeaps?, NU din categoria faptelor grave ?i foarte grave, poate s?-?i pl?teasc? eliberarea.

    Cuantumul unei zile amend? se stabile?te în func?ie de posibilit??ile materiale ale condamnatului ?i poate fi între 10 ?i 500 de lei. Num?rul acestor zile îl stabile?te magistratul. Ar mai fi arestul la domiciliu care va trebui s? implice monitorizarea condamnatului cu o br??ar? dotat? cu cip.

    Se introduce judec?torul de drepturi ?i libert??i. Mai exact, un magistrat care se va ocupa strict de m?surile preventive. Arestul preventiv, obliga?iile de a nu p?r?si ?ara ori localitatea ?i altele care vor intra exclusiv în atribu?iile acestei func?ii.

    Apare no?iunea de suspect care o înlocuie?te, practic, pe cea de învinuit. Adic? odat? cu începerea urm?ririi penale în privin?a unei persoane aceasta devine suspect.

    Audierile în cazurile suspec?ilor ori a inculpa?ilor se vor înregistra cu mijloace tehnice audio sau audiovideo. Dac? unele structuri de anchet? nu au astfel de echipamente vor fi obligate s? consemneze în procesele verbale întocmite în cauz? aceste aspecte.

    Ceva mai drastic? va fi legea în ceea ce îi prive?te pe recidivi?ti sau pe cei care comit fapte concurente, mai multe infrac?iuni comise cu aproxima?ie în acela?i timp f?r? s? fie condamna?i cronologic. Mai exact, dac? o persoan? este condamnat? la trei fapte, spre exemplu, una de patru ani, celelalte de câte doi ani, va executa pedeapsa cea mai mare, de patru ani. Dar va mai primi un spor, obligatoriu, ce reprezint? o treime din suma matematic? a faptelor neexacutate.

    Pe de alt? parte, vor fi incriminate, din nou, insulta ?i calomnia, limitând astfel informa?iile ce vor putea fi publicate în pres?.

    Sursa :

    OFF@ S-A DUS TARA ASTA DE RAPA. V-or iesi criminali si violatori din inchisori si va fi haos , again , hotii la hoti trag. In loc sa aspreasca legile pentru criminali si pentru violatori , etc.. , Guvernu a hotarat sa elibereze in jur de 1000-5000 detinuti, bineinteles , ca sunt alegeri politice anul acesta.Un lucru bun este in toata mizeria asta : Legalizeaza Prostitutia :) Deci o sa avem si noi Puf ca in Germania , sau poate cine stie , sau ca in Olanda, fetitele in geam... ;)

  6. Buna.In acest tutorial va v-oi arata cum sa intariti securitatea , cu grsec . Sa incepem :

    1.Trebuie sa compilam kernelul :

    aptitude install patch bin86 kernel-package build-essential

    2.

    aptitude install libncurses5-dev

    3.Sa fie instalat : iniramfs-tools , si il verificam :

    cd /usr/src
    dpkg -l initramfs*

    4.Instalam grsec, dar sa fie in /usr/src

    wget grsecurity.net/grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz
    .

    5.Instalam tot un kernel ce face parte din grsec :

    wget eu.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.5.tar.gz

    6.Trebuie sa i dam winrar..

    tar -xzvf linux-2.6.24.5.tar.gz
    ln -s linux-2.6.24.5 linux

    7.Mutam Kernelul , la noul patch :

    mv grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz linux/grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz

    8.Dam comanda:

    cd linux

    9.

    gunzip < grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz | patch -p1

    10.Apoi in :

    root@sleed:~# make menuconfig

    --->Te duci la options - > Grsecurity -> Tick Grsecurity

    Te duci la Security level , si dai High.

    11.Compilezi kernelu:

    make-kpkg clean

    12.Lansezi compilatia

    make-kpkg --initrd --append-to-version "grsec1.0" kernel_image

    Sau poti instala clean , mai simplu prin :

    make mrproper

    make menuconfig

    make clean

    make

    make modules_install

    mkinitramfs

    make install

    13.Instalezi kernelu :

    Sa compilat kernelu , si o fila . deb s a generat in /usr/src. Instalam kernelu prin :

    dpkg -i linux-image-2.6.24.5-grsec_grsec1.0_i386.deb

    In timpul instalarii , o initdr imagine , se va crea , asta depinde si de performantele tale de pc. Trebuie sa te uiti prin comanda aceasta

    file vmlinuz-2.6.24.5-grsec
    sa fie ok instalat.

    14. In

    /usr/src/linux
    , Restartezi Sistemul de Operare , prin:
    shutdown -r now
    ,
    uname -r
    , verificam daca e instalat grsecu , si trebuie sa apara 0.2.3.4.....-grsec

    Sursa :

    + ceva parti am ajustat si eu + testat si merge 100%.

    @ Acest tutorial a fost realizat si cu sprijinul lui Tex, Aelius.

×
×
  • Create New...