Bra Linuxkommandon

August 11th, 2012 No comments

top -s (Visar vilka processer som tar mest processorkraft)

ps (Visar aktuella processer)

ps -A|more (Visar alla processer)

ps -eaf | grep -i smb (visar vilken användare/rättighet en process (smb) körs med)

find / -name foo (Sök efter en fil i alla mappar)

hostname (visar hostname / ändrar temporärt hostname)

/etc/hostname (textfil med hostname i Debian, ändra för att ändra host perm.)

sudo /etc/init.d/hostname.sh (kör detta skript för att ladda in hostnamn, Debian)

setxkbmap se (Byter till svenskt tangentbord i Ubuntu)

tail -f file.log (Visar en textfil kontinuerligt. Avbryt med CTRL+C)

iostat -x 5 (visar hårddisk prestanda var 5e sekund) kräver paket “sysstat”

lsusb – listar USB enheter

lshal – info om hårdvara

lsattr – lista filattribut i ext2 filsystem

lshw – lista HW info, kör som root

lshw -html > datorinfo.htm – skapar HTML sida med HW info

lsmod – listar vilka kärnmoduler som laddats

lsof – listar öppna filer

lspcmcia – listar PC-Card

Ref: http://webtools.live2support.com/linux/top.php

Förnya DHCP-adress: sudo dhclient

alt.2: sudo /etc/init.d/networking restart

alt.3: ifdown eth0 && ifup eth0

—————————————-

Byt till statisk IP på Ubuntu server:

Ref: http://www.howtogeek.com/howto/ubuntu/change-ubuntu-server-from-dhcp-to-a-static-ip-address/

Edit file: sudo nano /etc/network/interfaces

Change to your info:

auto eth0

iface eth0 inet static

address 192.168.1.100

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.1

Add in the DNS: sudo nano /etc/resolv.conf

Remove the dhcp client: sudo apt-get remove dhcp3-client (or dhcp-client)

Restart net: sudo /etc/init.d/networking restart

—————————————-

Omkonfig Ubuntu Desktop: sudo dpkg –configure -a

Konfig X grafik: sudo dpkg-reconfigure xserver-xorg

Kolla Direct Rendering: glxinfo | grep rendering

Starta run-level 1 Recovery mode: sudo init 1

Avsluta Recovery mode: init 2

Uppdatera program och Ubuntu:

apt-get update (synkroniserar lista över program)

apt-get upgrade (uppdaterar alla installerade program till senaste versionen

apt-get dist-upgrade (uppdaterar till senaste, stabila versionen av Ubuntu)

Ändra grafikinställningar i Ubuntu: http://ubuntuforums.org/showthread.php?t=83973

Categories: Linux Tags:

Computer Inventory with PowerShell

August 11th, 2012 No comments
Categories: Windows Tags:

Retrieve data from Lotus Notes with PowerShell

August 11th, 2012 No comments
Categories: Windows Tags:

Pash PowerShell open source reimplementation

August 11th, 2012 No comments

For Mac, Linux, Solaris, etc… and Windows (including Windows Mobile and Windows CE):

http://pash.sourceforge.net/

Categories: Linux, Mac Tags:

Migrera Lotus Notes till Thunderbird

August 11th, 2012 No comments

1. Ladda ner Thunderbird och installera det.

2. Aktivera IMAP för användaren på Notesservern.

3. Koppla upp dig mot Notesservern i Thunderbird via IMAP och läs ner alla mail.

4. Gör backup av Thunderbird profil:

http://email.about.com/od/mozillathunderbirdtips/qt/et_backup_prof.htm

5. Gör en restore på nya datorn:

http://email.about.com/od/mozillathunderbirdtips/qt/et_restore_prof.htm

Categories: Windows Tags:

Ändra logon bild i Win7

August 11th, 2012 No comments

1. Skapa följande reg-nyckel

HKLM\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background

2. Lägg till ett DWORD OEMBackground med värde 1

3. Skapa en ny mapp %windir%\System32\oobe\info\backgrounds

4. Lägg bilden i mappen och döp om den till backgroundDefault.jpg

max 256kb stor bildfil!

Categories: Windows Tags:

Swap in Linux

August 11th, 2012 No comments

Good article about swap files in Linux / Debian / Ubuntu:

http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space

Categories: Linux Tags:

Repair WinXP boot from CD

August 11th, 2012 No comments

Insert the Windows XP bootable CD into the computer.

Boot to the Windows CD

Once in the Windows XP setup menu press the “R” key to repair Windows.

Log into your Windows installation by pressing the “1” key and pressing enter.

You may then be prompted for your administrator password, enter that password.

Type command: FIXMBR

Type command: FIXBOOT

Copy the below two files to the root directory of the primary hard disk. In the below example we are copying these files from the CD-ROM drive letter, which in this case is “d.” This letter may be different on your computer.

copy d:\i386\ntldr c:\

copy d:\i386\ntdetect.com c:\

Once both of these files have been successfully copied, remove the CD from the computer and reboot.

Categories: Windows Tags:

Repair Mac OS via Linux

August 11th, 2012 No comments

First of all, you must have a copy of the physical disk image, in case the tool destroy all the data (you never know).

So, take another big disk and make a dd of it (or, better, a forensics dd: ddrescue for example http://www.forensicswiki.org/wiki/Ddrescue ).

dd if=/dev/hda of=mybigfile.img bs=65536 conv=noerror,sync

after that, put your mybigfile.img in a secure place.

Second, if the hardware is defective, you must use a good disk, and restore your disk image on it:

dd if=mybigfile.img of=/dev/hdx bs=65536

After that, you must use a recovery tool. You can check many recovery tools, but in the first place I would try with fsck.hfs ( http://linux.die.net/man/8/fsck.hfs ).

I can’t suggest you any other hfs+ recovery tool, because I didn’t have the need to use it. Try a look on internet, and always work on a COPY of the IMAGE you made on the first step!

/HappyCactus

to change the permissions you need to be a super-user (root).

You accomplish this by typing ‘sudo su’, and then the password for your account. This makes you root.

Next, execute the command: chmod -R 777 /path/to/your/mounted/devi

ce.

That will remove the perimssions restrictions from every file on the disk.

/DrDamnit

Categories: Linux, Mac Tags:

DNS-323 SSH

August 11th, 2012 No comments

För att lägga till SSH stöd i DNS-323:

http://www.bergek.com/2008/11/13/dlink-dns-323-part-3-fonz-fun_plug/

För att lägga in ett RSYNC jobb via CRON:

http://wiki.dns323.info/howto:backup

DNS323 + Duplicity = Encrypted Offsite Backup BLISS!:

http://www.drak0.com/2008/06/09/dns323-duplicity-encrypted-offsite-backup-bliss/

Modding Cron on the D-Link DNS-323 using funplug-0.3:

http://techblog357.blogspot.com/2007/08/modding-cron-on-d-link-dns-323-using.html

Modding ‘crontab’ on Fujitsu Q700:

vi /etc/config/crontab

crontab /etc/config/crontab

Categories: Bash, Linux Tags: