can't complete Arch Linux installation guide - archlinux

I'm following arch linux installation guide (this one) step by step, but in some point I can't continue, in this part:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
It can't be done because the file doesn't exist
Any idea?

The command you are talking about is not meant literally.
Region should be replaced with your region.
City should be replaced with the name of a big city inside your region.
Arch Linux does not have a file for every city in the world, but has files for the larger cities. So choose a large city which is close to you.
I live in Vienna, so my command looks like this:
ln -sf /usr/share/zoneinfo/Europe/Vienna /etc/localtime
While you write the command into the shell, you can use tab-completion to see if the region/city you want to choose exists as an Arch-Linux-file/directory.

the command you are using might be old. I just did an arch install and when using your command I received cannot access /etc/localtime no such file for directory.
However, in the /etc/local* I found /etc/locale.gen and it set my timezone when doing the date command to see
so try for example
ln -sf /usr/share/zoneinfo/Canada/Eastern /etc/locale.gen

Are you sure the timezone you are using exists?
The available timezones can be checked using ls /usr/share/zoneinfo/*/*

Related

SSH opening file error - no idea why

Running Debian Linux - newest version.
cp /included/filename /usr/bin/
It gives me error "cannot stat '/included/filename': No such file or directory
I don't get why there should be an error. I am doing it as superuser.
From your latest comment i conclude you got the paths mixed up. If you want to copy the file install.sh located under /usr/bin/included/ you would need to do
cp /usr/bin/included/install.sh /usr/bin/
to make something similar to your provided command work, id assume you are in /usr/bin and the first argument needs to be a relative one
cd /usr/bin
cp ./included/install.sh /usr/bin/
Please provide more information on what you are trying to do and provide realworld example code.

Creating pg_dump file in OS terminal

I tried to find it out on google, but didn't worked well so I hope to find help here! :)
I am trying to create a pg_dump file on mac osx but there is no \bin folder as needed in cmd on windows.
My question is how to create the pg_dump file on mac osx?
Best regards!
Depends on where you installed PostgreSQL from. If its the .dmg from postgresql.org then the command will be in:
/Library/PostgreSQL/<version eg. 9.6>/bin
This is not in the PATH so you will have to either cd to the directory and run the command or add the directory to the PATH.
Another option is to search for the command with:
cd /
find ./ -name pg_dump

Changing password of a Virtual Machine

I have some virtual machines with me. I want to write a script which automates the following process...
It mounts the virtual machine (with linux as the os) to a location say /mnt/image
It modifies the /etc/passwd (or the equivalent file) to change the password of the user
Unmount the virtual machine
Since, I am using libvirt I am having some qcow2 images of the virtual machine. to mount the image on my ubuntu, I am using nbd module. Here are the commands that I am trying :
modprobe nbd max_part=63
qemu-nbd -c /dev/nbd0 image.qcow2
mount /dev/nbd0p1 /mnt/image
It gives me the error:
mount: special device /dev/nbd0p1 does not exist
When I replace nbd0p1 with nbdo I am getting the following error (though I am not sure what I am trying to do by this)
mount: you must specify the filesystem type
Any suggestions so as what could be the problem... ?
Check that /sys/modules/nbd/parameters/max_part has the expected value. If it's 0 or too low, the partitions /dev/nbd0p1, etc. will not be made available by the kernel. This can happen if the nbd kernel module was already loaded (with a different max_part parameter) when you ran modprobe.
You can fix that by unloading the module and modprobing it again.
[Not a direct answer to the question, but an alternate]
You can try to convert qcow2 image to raw and then, mount the raw image.
convert:
qemu-img convert -f qcow2 image.qcow2 -O raw image_raw.raw
mount:
sudo losetup /dev/loop0 image_raw.raw
sudo kpartx -a /dev/loop0
sudo mount /dev/mapper/loop0p3 /mnt/image
sudo mount /dev/mapper/loop0p2 /mnt/image/boot
Could it be that the partition isn't in the first slot in the MBR, or an extended partition is in use? Check to see if any other nbdXpY device nodes are being created, or run fdisk on it and print the partition table.
I stumbled on the same issue and same error but on a vdi
qemu-nbd -c /dev/nbd0 image.vdi
for me the solution was simple I just changed nbd0 to nbd1
qemu-nbd -c /dev/nbd1 image.vdi
and then:
sudo mount /dev/nbd1p1 /media/eddie/virtual
worked.
Please leave a comment if this worked for you also and on what type of image.

How to make a command-line tool executable in OS X?

I just finished writing my very first command-line tool in Objective-C, compiled it, and now I'm curious about how one would go about making it executable as a command.
For example, right now to use the program I have to type in ./filename -args into Terminal. I'd like to be able to only type in filename and execute the program.
I tried using sudo chmod a+x filename but no go.
sudo cp filename /usr/local/bin/
Or add the directory containing filename into $PATH. Like as all other UNIX-derived OSs.

Uninstall Mono from Mac OS X v10.5 Leopard

I installed Mono on my iMac last night and I immidiately had a change of heart! I don't think Mono is ready for prime time.
The Mono website says to run the following script to uninstall:
#!/bin/sh -x
#This script removes Mono from an OS X System. It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-SVN.pkg
cd /usr/bin
for i in `ls -al | grep Mono | awk '{print $9}'`; do
rm ${i}
done
Has anyone had to uninstall Mono? Was it as straight forward as running the above script or do I have to do more? How messy was it? Any pointers are appreciated.
The above script simply deletes everything related to Mono on your system -- and since the developers wrote it, I'm sure they didn't miss anything :) Unlike some other operating systems made by software companies that rhyme with "Macrosoft", uninstalling software in OS X is as simple as deleting the files, 99% of the time.. no registry or anything like that.
So, long story short, yes, that script is probably the only thing you need to do.
Year 2017 answer for those, like myself, looking at SE first and official docs later (FYI I know the question was for OS Leopard). Run these commands in the terminal:
sudo rm -rf /Library/Frameworks/Mono.framework
sudo pkgutil --forget com.xamarin.mono-MDK.pkg
sudo rm -rf /etc/paths.d/mono-commands
Seems the uninstall script has been slightly modified as today (2011-07-12):
#!/bin/sh -x
#This script removes Mono from an OS X System. It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-*
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
(cd ${dir};
for i in `ls -al | grep /Library/Frameworks/Mono.framework/ | awk '{print $9}'`; do
rm ${i}
done);
done
You can find the current version here.
By the way: it's the same exact thing that runs the uninstaller mentioned by joev (although as jochem noted it is not located in the /Library/Receipts, it must be found in the installation package=.
To expand on feelingsofwhite.com's answer, the Mono installer for Mac OS puts the uninstall script in the /Library/Receipts directory, not in the installer image as it says in the Notes.rtf file. The Receipts directory is what the Mac OS Installer.app uses to keep track of which packages were responsible for installing which files. Usually, a list of these is kept in a .bom ("Bill of Materials") file, which can be explored with the lsbom command.
In the case of Mono, they also add a whole bunch of links from your /usr/bin and man directories. Their uninstall scripts finds these and removes them. Since the uninstall script lives in a place the uninstaller deletes, you should probably copy the uninstall script somewhere else before running it:
cd
cp /Library/Receipts/MonoFramework-2.4_7.macos10.novell.universal.pkg/Contents/Resources/uninstallMono.sh .
sudo ./uninstallMono.sh
rm uninstallMono.sh
http://dragthor.wordpress.com/2007/07/24/uninstall-mono-on-mac-os-x/
Work for me, OSX, But I Use the uninstall script file (.sh) from the Mono Installer Package.
Mono doesn't contain a lot of fluff, so just running those commands will be fine. It's as simple as deleting all the data folders, and the binaries.
I just deleted the mono.frameworks folder. I got tired of answering "yes" billions of times...