Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Sunday, November 10, 2013

Linux package management

apt-get

Really, you need these commands again? What, you have forgotten the obscure command lines to remove a simple package? Well you are bad and you should feel bad.
Personally I always forget these myself so I thought why not a quick and easy reference for apt-get package management. ‘apt-*’ : APT is acronym for Advanced Package Tool.
Do you like cows?
apt-get moo
Search on my local Linux box connected repositories for something cool
apt-cache search {something cool}
Install an application (from a currently connected repository)
apt-get install {package-name}
List applications that are installed on this
boxdpkg-query –l
or
apt-cache pkgnames | more
Once you know the name of the packages that offended you delete it with
apt-get remove --purge {package-name} [Dave here, note - - is 2 dashes)

If you have upgraded, updated or removed some packages run this to clean up the package cache
apt-get autoclean
If you are running out of space and don't need a cache of local apps, say for example you are connected to the internet, be a bit more ruthless. If you want to see how big it is first (du -sh /var/cache/apt/archives)
apt-get clean
If something is broken use the automatic fix command first
apt-get install –f
If you have not been on this box for while run this to update the lists, and versions of packages in the attached repositories
apt-get update
If you are feeling like you still miss Windows Update use this command
apt-get upgrade
Maybe you just need some extra details on a package in use on this computer
apt-cache show {package_name}


Great reference for this: https://help.ubuntu.com/community/AptGet/Howto





Thursday, April 18, 2013

SCVMM 2012 SP1 and Linux

 

To automatically configure the Linux OS after SCVMM creates the OS there are extra tools that are needed. On the VMM management server, open a command prompt, (administrative).

They programs are found in the c:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\agents\Linux folder.

Copy all the agent installation files from that folder to a new folder on the virtual machine, and then, on the virtual machine on which Linux is running as a guest operating system, open the new folder.

Make the installer executable

chmod +x install

Run either the x86 or x64 installer:

./install scvmmguestagent.1.0.0.544.x64.tar

or

/install scvmmguestagent.1.0.0.544.x86.tar

 

image

The official Microsoft link is: http://technet.microsoft.com/en-us/library/jj860429.aspx

Monday, April 15, 2013

Linux, on Hyper-V Server 2012

 

Supported Linux on Hyper-V 2012,  ALL Are 64 BIT ! (http://technet.microsoft.com/en-us/library/hh831531.aspx)

CentOS 5.7 and 5.8, CentOS 6.0 – 6.3 (Download and install Linux Integration Services Version 3.4 for Hyper-V.)

Red Hat Enterprise Linux 5.7 and 5.8, Red Hat Enterprise Linux 6.0 – 6.3 (Download and install Linux Integration Services Version 3.4 for Hyper-V.)

SUSE Linux Enterprise Server 11 SP2 (Integration services do not require a separate installation because they are built-in.

Open SUSE 12.1 (Integration services are built-in.)

Ubuntu 12.04 (Integration services are built-in.)

 

Dont forget there are Integration Services AND an SCVMM Agent

(http://windowsitpro.com/virtual-machine-manager/deploy-linux-scvmm )

Checking the OS (Red Hat)

Checking Redhat version installed

$ uname -a

Linux server.domain.com 2.4.22-32.ELsmp #1 SMP Mon Apr 15 21:17:59 EDT 2005 i686 i686 i386 GNU/Linux

To get the version in simple terms, check  /etc/redhat-release instead.

$ cat /etc/redhat-release

Red Hat Enterprise Linux AS release 3 (Taroon Update 5)

image

To turn on DHCP for Red Hat

To configure a DHCP client manually, modify  the /etc/sysconfig/network file to enable networking and the configuration file for each network device in the /etc/sysconfig/network-scripts directory. In this directory, each device should have a configuration file named ifcfg-eth0, where eth0 is the network device name.

The /etc/sysconfig/network file should contain the following line:

NETWORKING=yes


The NETWORKING variable must be set to yes if you want networking to start at boot time.



The /etc/sysconfig/network-scripts/ifcfg-eth0 file should contain the following lines:



DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes


Other options for the network script include:





  • DHCP_HOSTNAME — Only use this option if the DHCP server requires the client to specify a hostname before receiving an IP address. (The DHCP server daemon in Red Hat Enterprise Linux does not support this feature.)





  • PEERDNS=<answer>, where <answer> is one of the following:





    • yes — Modify /etc/resolv.conf with information from the server. If using DHCP, then yes is the default.





    • no — Do not modify /etc/resolv.conf.







  • SRCADDR=<address>, where <address> is the specified source IP address for outgoing packets.





  • USERCTL=<answer>, where <answer> is one of the following:





    • yes — Non-root users are allowed to control this device.





    • no — Non-root users are not allowed to control this device.







https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/System_Administration_Guide/s1-dhcp-configuring-client.html

Wednesday, February 13, 2013

P2V–Poverty pack edition for Linux

 

If you are running a tight (nah free, nah hobo data centre) you may from time to time need to P2V your Linux server to run it under VirtualBox. Here are some ways how:

If you have a USB HDD

Boot a Linux live CD, mount your USB somewhere, lets say /media/bigusb then simply run:

df –h (to find your {localdrivename})

dd if=/dev/{localdrivename} of=/media/bigusb/p2vdrive.raw

unmount the bigusb and move it to your virtualbox server, then run

VBoxManage convertdd p2vdrive.raw p2vdrive.vdi --format VDI

If you have a server

dd if=/dev/{localdrivename} | ssh logonname@ipAddress "dd of=/media/bigdisk/p2vdrive.raw"

VBoxManage convertdd p2vdrive.raw p2vdrive.vdi --format VDI

 

And away you go..

Monday, December 24, 2012

Windows password recovery USB

 

Most of these providers are going to payed supply and the instructions are awful. Here is the best one I found and used the other day.

Full web site: http://pogostick.net/~pnh/ntpasswd/ 

Download files for USB install usb110511.zip (~3MB) (md5sum: 50ced8d2a5febe22199f99acec74e63b)

How to make an bootable USB drive

Get a soon to be blank USB

Copy the files from the above usb*.zip onto the USB drive root folder

either as root or via sudo, use disk utility or df or any other utility to find the usb drive name (generally /dev/sdb1)

unmount the drive if it mounted, either as root or via sudo,

syslinux.exe –ma /dev/sdb1

Boot and away you go..

image

Tuesday, November 20, 2012

LDAPSearch Commands Cygwin

 

LDAPSearch

appBackLink
ldapsearch  -x -v -H LDAPS://DomainController.domain.com.au -D cn=ColvinD,ou=Sys,ou=IT,ou=ROOT,o=ORG -w SpecialPassword "(cn=Lotus Notes 5)"

appBackLink
objectClass: appApplication
ldapsearch  -x -v -H LDAPS://DomainController.domain.com.au -D
cn=ColvinD,ou=Sys,ou=IT,ou=ROOT,o=ORG -w SpecialPassword "(cn=Lotus Notes 5)"

equivalentToMe: cn=ColvinDU,ou=Sys,ou=IT,ou=ROOT,o=ORG
member: cn=ColvinDU,ou=Sys,ou=IT,ou=ROOT,o=ORG

ldapsearch  -x -v -H LDAPS://DomainController.domain.com.au -D
cn=ColvinD,ou=Sys,ou=IT,ou=ROOT,o=ORG -w SpecialPassword objectclass:groupOfNames member

ldapsearch  -x -v -H LDAPS://DomainController.domain.com.au -D
cn=ColvinD,ou=Sys,ou=IT,ou=ROOT,o=ORG -w SpecialPassword -b "ou=NAL Objects,ou=CAS,o=SHC"
objectclass:appApplication appBackLink >>nal-users.txt

ldapsearch  -x -v -H LDAPS://DomainController.domain.com.au –D cn=ColvinD,ou=Sys,ou=IT,ou=ROOT,o=ORG -w SpecialPassword "(cn=Lotus Notes 5)" appBackLink

To get the assigned users to the object below.

ldapsearch -x -v -H LDAPS://DomainController.domain.com.au -D cn=ColvinD,ou=Sys,ou=IT,ou=ROOT,o=ORG -w SpecialPassword -b "ou=CAS,o=SHC"cn=ACCESSDB-SHORTCUT-RRIVALS-2K ACL

 

To create a group via LDAPAdd

$ cat group.ldif

dn: cn=xxaaxx,ou=ROOT,o=ORG

objectclass: group

cn: xxaaxx

$ ldapadd -x -v -H LDAPS://DomainController.domain.com.au -D cn=ColvinD,ou=Sys,ou=IT,ou=ROOT,o=ORG -w SpecialPassword -f group.ldif

 

To configure LDAP for SSL

$ cat /etc/openldap/ldap.conf

# LDAP Defaults

# See ldap.conf(5) for details

# This file should be world readable but not world writable.

#BASE ou=ROOT,o=ORG

URI ldaps://domainController

TLS_REQCERT allow

#SIZELIMIT 12

#TIMELIMIT 15

#DEREF never

# Define SSL and TLS properties (optional)

TLSCertificateFile /var/openldap/scdata.der

TLSCertificateKeyFile /var/openldap/scdata.der

TLSCACertificateFile /var/openldap/scdata.der

# you should set the loglevel to 256 initially, this will give you

# some good hints when debugging problems. Read man slapd.conf what the loglevel

# directive will give you

loglevel 256

$ ls /var/openldap/

openldap-data openldap-slurp run scdata.der

$ ldapsearch -x -v -H LDAPS://DomainController.domain.com.au -D cn=ColvinD,ou=Sys,o

u=IT,ou=ROOT,o=ORG -w SpecialPassword

 

Base 64 decoder

required for some Novell NDS objects
http://makcoder.sourceforge.net/demo/base64.php

End of document

Wednesday, November 07, 2012

Handbrake for Ubuntu – the easy way

 

I am sick of half baked instructions, this is all you need to download and install Handbrake for Ubuntu precise (12.04) 64bit:

 

sudo add-apt-repository  ppa:stebbins/handbrake-releases

sudo apt-get update

sudo apt-get install handbrake-gtk handbrake-cli

 

Then you run it, end of story…

Tuesday, August 14, 2012

Create Windows 7 64bit USB flash install media on Linux PC

(this was so easy before I never bothered to blog it, but this time, maybe because it was 64bit, maybe because of the colour of the moon, it took about 4 different attempts, so here it is…)

Use either df or other command to find your USB device

$ df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda1       691G  488G  169G  75% /
udev            3.8G   12K  3.8G   1% /dev
tmpfs           1.6G  940K  1.6G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            3.9G  436K  3.8G   1% /run/shm
/dev/loop0      5.3G  5.3G     0 100% /mnt/iso
/dev/mmcblk0p1  3.8G   32K  3.8G   1% /media/72AD-2013_
/dev/sdb 8G 0G 8G 0% /media/usbdrive

 

Check what device your USB media is assigned above it is /dev/sdb.

 

Use gparted to dismount and format the drive to NTFS (creates /dev/sdb1 on /dev/sdb)

 

Mount ISO and USB media:

$ sudo mkdir /mnt/iso

$ sudo mkdir /mnt/usb

$ sudo mount -o loop Windows7-64bit.iso /mnt/iso

$ sudo mount /dev/sdb1 /mnt/usb

 

Copy over all files (GUI or command line):

$ cp -r /mnt/iso/* /mnt/usb/

 

Download, untar, and install (make, sudo make install) ms-sys from here.

Use ms-sys to install a Windows 7 Master Boot Record on the USB stick:

$ ms-sys -7 /dev/sdb

 

And away you go…

Friday, February 17, 2012

VirtualBox Network command lines

 

If you run a bunch on VMs in VirtualBox and use NAT to keep consistent addresses changing the active network card (from wireless to wired etc) on the computer is a pain as you need to go into the VM and click disconnect network, ok, connect network ok.

Well that is way to may steps for my liking. Here is the command line to pop and icon in the desktop or run as a task/script.

vboxmanage controlvm "WORK SOE" setlinkstate1 off
vboxmanage controlvm "WORK SOE" setlinkstate1 on

If you want to change the network adaptor connection (ie, not connected or to the NAT), this is how.

vboxmanage controlvm "w2k8r2dc1" nic1 null
vboxmanage controlvm "w2k8r2dc1" nic1 nat

You can also start and sleep them on the command line.

vboxmanage controlvm "nameOmachine" savestate
vboxmanage startvm "nameOmachine"

And just to suspend the laptop from the command:
sudo pm-suspend


image

Thursday, February 02, 2012

Want ‘proper’ Java on Ubuntu 11.10?

 

I am of course an open source fan, but when it doesn't work, it is time for some proprietary solution. IE, Webex did not work with Icedtea Java Plugin and OpenJDK. Error "applet not initialized” at the bottom of the browser window.

So either apt-get remove or ubuntu software centre, remove OpenJDK and IcedTea java components.

then copy and paste the following:

cd 
wget https://raw.github.com/flexiondotorg/oab-java6/master/oab-java6.sh -O oab-java6.sh
chmod +x oab-java6.sh
sudo ./oab-java6.sh
sudo apt-get upgrade

Open the browser and go to:

http://java.com/en/download/installed.jsp

It was ask for a plug in, select the IcedTea java plug and you should be sweet.

Furth (dated) details here:

https://github.com/flexiondotorg/oab-java6

Monday, January 23, 2012

Citrix client on Ubuntu 11.10 (x64)

 

Linux Citrix Client v12

Go to Citrix.com, Downloads, Choose the Citrix Receiver for Linux x64.

Download Receiver for Linux English v12.0 10/5/11 .deb (format)

The Ubuntu installer will automatically install it, all you need is the certificates (if you get a cert error).

If you have Firefox already installed you can grab them (the destination path has changed from Ubuntu 10 and 11 for the client installation).

sudo cp /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts/

And you are up and running.

Thursday, January 19, 2012

Removing Unity from Ubuntu 11.10

 

Prerequisites before starting, get updated

sudo apt-get update

Install gnome classic

sudo apt-get install gnome-session-fallback

Log out then login and choose Gnome Classic from the little configuration button

Remove Unity packages and Unity specific tools

sudo apt-get purge appmenu-gtk appmenu-gtk3 appmenu-qt indicator-appmenu

sudo apt-get remove unity-lens-music unity-lens-applications unity-greeter unity-common unity-asset-pool unity-2d-launcher unity-2d libunity-misc4 libunity-2d-private0 gir1.2-unity-4.0

sudo apt-get purge liboverlay-scrollbar-0.2-0 liboverlay-scrollbar3-0.2-0 overlay-scrollbar appmenu-gtk appmenu-gtk3 appmenu-qt indicator-appmenu

Move the window chrome button to the same side as Windows, ie move from left side to right side.

sudo apt-get install gconf-editor

run gconf-editor in a terminal window

Navigate on the left of /apps/metacity/general
on the right side find the string button_layout and change it to :minimize,maximize,close

image

Logout and/or reboot. You are done.

Original geek who documented most of this: http://linux-software-news-tutorials.blogspot.com/2011/10/ubuntu-1110-oneiric-remove-unity-and.html

Thursday, September 08, 2011

Linux Citrix Client v11

 

Go to Citrix.com, Downloads, over on the right choose the Citrix Receiver (you need to go this way as Linux is not a client if you go via standard downloads).

Download the client

GUNzip the .gz: tar xfvz linuxx86-11.xxx.tar.gz

UnTAR the tar: tar xfvz linuxx86-11.xxx.tar

Change to the folder created

Execute the install script: sudo ./setupwfc

Accept the default options

 

If you need it motif?:

sudo apt-get install libmotif4

 

If you need funky certificate support:

If you have Firefox already installed you can grab them.

sudo cp /usr/share/ca-certificates/mozilla/* /usr/lib/ICAClient/keystore/cacerts/

Friday, August 19, 2011

Copy XenServer to USB for installation

 

I used XenServer version 5.6.

  1. Format USB key with Fat32
  2. Ubuntu comes with “syslinux” (or download it from source) http://syslinux.zytor.com/wiki/index.php/Download
  3. Type mount to see where the USB is mounted
  4. Run ‘syslinux.exe /mnt/somewhere ‘ replacing with the mount point of the USB
  5. Copy the contents of the extracted “XenServer-5.X.X-install-cd” folder to the root of the USB
  6. On the USB drive, copy the contents of the /boot/isolinux folder to the root of the USB
  7. On the root of USB drive, rename the ‘isolinux.cfg’ file to ‘syslinux.cfg’
  8. On the root of USB drive, rename the ‘isolinux.bin’ file to ‘syslinux.bin’
  9. If you get an “mboot.c32: not a COM32R image” error, (version 4.x of syslinux) copy the mboot.c32 from your downloaded copy of syslinux to the root of your USB drive

Blog Archive