Tag Archive for 'Linux'

Script pentru afisare utilizatori linux, bash login, home directory

#!/bin/bash

case $1 in
( list-users )
reset
echo “Listing users….. :)
cat /etc/passwd |cut -d ‘:’ -f1
;;

( list-valid-users )
reset
echo “Listing valid users for god >:)”
cat test|grep -w  “/bin/sh”$|cut -f1 -d’:’
cat test|grep -w  “/bin/bash”$|cut -f1 -d’:’
;;
( get-user-home )
reset
echo “Listing the users home…and username”
echo “home directori for:” $2
cat /etc/passwd|grep  $2|cut -f6 -d’:’
;;
( * )
reset
echo “Utilizati una din urmatoarele comenzi…”
echo “list-users | list-valid-users | get-user-home <nume utilizator>”

;;

esac

  • Share/Bookmark

Download Manager BASH

Anul trecut la faculta avem de facut un download manager in bash la SO(Sisteme de operare) printre altele, era un proiect destul de interesant dupa parerea mea, dar ar fi mult mai interesant sa fi avut si o interfata web un script php care sa apeleze comenzile de bash jumatate php jumatate bash
nu ii prea ok vi acasa din oras “obosit” si inainte sa te arunci la un somn verifici email-ul si vezi o chestie interesanta si o pui sa downlodeze pe un Network Storage pe care ruleaza linux si ai download manager in bash

deschizi putty te logezi pe ssh pe network storage si dai sa downlodeze “the thing” timpul acesta sar scurta daca ai aveo o interfata grafica pe network storage care sa faca downlodurile pe care le dai si nu ai fi nevoit sa iti belesti ochii in fereastra de putty in “noptile lungi” :)

Am uitat sa mentionez ca proiectul a fost facut cu 7 ore inainte de al prezenta deoarece ca deobicei am uitat prezentarea de proiect si asa ajungi sa lucrezi noaptea. :)

Download the Download Manager bash

  • Share/Bookmark

how to run a script at boot time?

Your script should be in /etc/init.d/ directory.
Then you have to make a symlink from your run-level directory.
I.e you’re in run-level 5 (multiuser with X)

chmod +x
cp /etc/init.d
ln -s /etc/init.d/ /etc/rc.d/rc5.d/S50
ln -s /etc/init.d/ /etc/rc.d/rc5.d/K50
  • Share/Bookmark

Unix Nerd Seeks Love – Funny Craigslist Post

This is a real posting at craigslist classifieds: There is a sad truth to the world today. I am part of a dying breed of people known as “shell users.” We are an old-fashioned bunch, preferring the warm glow of a green screen full of text over the cold blockiness of a graphical interface. We use ssh, scp, and even occassionally ftp. Back in the days before high-speed connections (”broadband”), we would dial up during off-hours to avoid being slammed with huge phone bills. The whole “Microsoft Windows” fad will fade away sooner or later, but in the interim, our kind is facing extinction.

Because there are fewer and fewer of us, I must help keep our lineage alive. I am looking for someone to help me do this. I need a woman (obviously) who is willing to raise a child with me in the method of Unix. Our child will be introduced to computers at a young age, and will be setting emacs mode before any other child can even read. I earn a sufficient income to support a family in modest comfort. Other than the fact our child will be bright, text-based and sarcastic, we will otherwise be a normal family. We will even go to Disney World and see Mickey Mouse.

So, if you are a woman between the ages of 23 and 43 who is ready to raise a child in the way of the shell, let me know so we can begin the process. (If you are ready to raise more than one child, even better.)

PS – yes, this is for real. Given the right person, I would obviously propose before we … call fork().
PPS – I only set emacs mode for my ksh session. I only edit files using vi. Just wanted to clear that up. And I’m looking to raise the child(ren) as a dedicated couple, so if you aren’t interested in being married, you may wish to select() a different posting.

N.B. – on the issue of relocation. I live in a place where my income/expense ratio is proper (i.e., greater than 2:1). I’m willing to live anywhere in the world where this remains true. I’ve been to much of the country as well as foreign nations. There are no limits to where I will live *so long as the job market for unix admins is robust enough to be sustainable.* And yes, I am interested in a strictly monogamous situation. I’ve been known to actually turn down offers of “two chicks at the same time.”

By ReverseMonster

  • Share/Bookmark

Debian pptpd HOWTO

Installing MPPE Support Most people want their tunnels encrypted. Check the version of your kernel; if it is below 2.6.15-rc1 then you do not have MPPE support. To check further, test like this:

# modprobe ppp-compress-18 && echo success

If this fails, follow the Debian MPPE HOWTO, then return here.


Installing the Server ProgramInstall the pptpd package from the Debian Project:

# apt-get install pptpd


Configure IP Address RangeEdit the file /etc/pptpd.conf for the IP address range, for example:

localip 192.168.0.1
remoteip 192.168.0.234-238,192.168.0.245

Note: see pptpd.conf(5) for more details on the other options.Note: you will need to restart pptpd to make changes to /etc/pptpd.conf effective:

# /etc/init.d/pptpd restart


Adding UsersConfigure /etc/ppp/chap-secrets for the accounts, for example:

# echo "username pptpd password *" >> /etc/ppp/chap-secrets

Note: this method has all the usernames in one file. There are other ways, including authentication using Radius, or using Samba. Check the mailing list (subscribe, archives).Note: you do not need to restart pptpd, a change to chap-secrets is effective for the next connection.


TestingAttempt a connection from a client. On successful connection, a new interface should be created (e.g. ppp0), and the remote IP address of the interface should be pingable. If so, the rest of your problems are likely to be routing.Note: if you need to set up a Debian test client, see the PPTP Client Debian HOWTO. The test client cannot be on the same host, it doesn’t work.To diagnose faults, enable the options debug dump in /etc/ppp/pptpd-options. The change is effective on the next connection. The debug output goes to /var/log/debug, and the dump output and usual output to /var/log/messages.


PatchingIf you need to adopt a source code change made in CVS after the version you are running, see our Applying patches to Debian pptpd page.


Performance NotesOn a Debian system there may be scripts run by pppd when a network interface is brought up. These scripts are in the /etc/ppp/ip-up.d directory.Some of these scripts may run with incorrect assumptions … in particular the Debian Sarge exim4 package includes a script /etc/ppp/ip-up.d/exim4 that restarts exim4 or runs the queue. The assumption in this script is that the system has just connected to the internet through the PPP link.You may wish to customise this script. If your server has a default route via an ethernet interface, then either remove the script or add an exit command near the top.


Comments

If you have comments on this document, please send them to the author at james.cameron at hp.com. But if you need help, use the mailing list (subscribe, archives) so that we can share the load.

Sursa

  • Share/Bookmark

Basic Linux Commands

cd (change directory)

cd myfolder

Changes the current working directory to “myfolder”

cd ..

Go up one level to the current working directory.

cd ../..

Go up two levels to the current working directory.

cd /

Changes the current working directory to the root directory.

cd ~

Changes the current working directory to your home directory.

Continue reading ‘Basic Linux Commands’

  • Share/Bookmark

Inca un pinguin la colectie

Am fost si eu astazi prin oras sa caut un cadou, nu dau nume pt cine ;) ) pana sa ma hotarasc ce cadou sa iau mi-am facut mie cadouri ptrintre care un pinguin care lam pus la colectie cu ceilalti “big happy penguin family” :) )

  • Share/Bookmark

Ubuntu PXE Install

hmmm trebuia sa instalez pe 23 de systeme windows/ubuntu :) , sa instalez pe fiecare in parte nici nu intra in vorba puteam sa instalez pe un sistem si sa fac clona cu norton si sa arunc clona pe fiecare sistem in parte si era ok sau prin retea sa butez clona…..sau cum avem ubuntu server cu ldap si samba m-am hotarat sa fac prin network boot :D

http://wiki.koeln.ccc.de/index.php/Ubuntu_PXE_Install

  • Share/Bookmark

What if…

Imi place :D ce sa spun linux on mobile si mai ales ubuntu mobile :D

  • Share/Bookmark

10 Good Reasons to Use Linux

Since its introduction in 1991, Linux has grown to become a much appreciated operating system capable of solving daily tasks for users in many areas. Here are several reasons why Linux may be right for you:

Continue reading ‘10 Good Reasons to Use Linux’

  • Share/Bookmark