On a nice fresh Linode
with CentOS or Debian: There is no cpan... or an insufficient one.
*CentOS: *$ sudo yum install perl-CPAN
OK, now
$ cpan
works great but, without any of the development tools, 'make' isn't
even found. Specifically you will see this error, drowning amongst a
sea of others:
Can't exec "make": No such file or directory
We need:
*CentOS: *$ sudo yum groupinstall 'Development Tools' *Debian:* $ sudo
apt-get install build-essential
And then:
$ sudo cpan cpan> install Test::More cpan> install Term::ReadLine
cpan> install Term::ReadLine::Perl *# At least on Debian, just ReadLine
is not enough* cpan> install Term::ReadKey
Here we assume that
You have set up a local working directory to edit the source code
of Simutrans-Experimental,
your favorite game; and
Tou would like to compile one of the branches to test it.
First, setup git. Now we go get James's repository:
$ git clone https://github.com/jamespetts/simutrans-experimental
List remote branches only:
$ git branch -r
List all remote branches, and lots of other info:
$ git remote show origin
Create a local branch to track a remote branch:
$ git branch --track running-powers origin/running-powers
Have our local working copy, track the named branch:
$ git checkout running-powers
Go get it
$ git pull
Show local branches:
$ git branch
10.x
master
* running-powers
OK let's build that:
$ make -j3
[...]
===> LD build/default/simutrans-experimental
Cool! Now, copy that binary to our games-playing directory:
$ cp -a build/default/simutrans-experimental ~/simutrans/sim-exp/
If some git commands refuse to proceed because they’re worried about
clobbering untracked files, and you’re certain that all untracked files
and directories are expendable, then delete them mercilessly with:
$ git clean -f -d
I edited my working copy of a project in git and now I can't do a
git pull to merge, because I added a few files. I don't have commit
privileges on the remote project, so I emailed them to the maintainer,
and now git won't merge them in. I get this error:
error: The following untracked working tree files would be overwritten by merge:
There are two ways to handle this:
git add .
Adds the names of the files in the local copy, to git's
concept of tracked files. Then a git fetch
will succeed.
git clean -n
will do a dry run (-n
) of a clean operation, which
will remove all non-tracked files from your local copy. If you
agree, git clean -d
will actually delete thosee files; then git
fetch
or git pull
will succeed.
If you have used svn for years, git can seem a little strange.
Half the problem is the different mindset -- let's tackle one common
problem: How do I know what will happen if I do a git fetch
or a git
pull
? First let's do a status:
$ git status
# On branch master
# Your branch is behind 'origin/master' by 3 commits,
and can be fast-forwarded.
That's a lot friendlier than svn's equivalent svn diff
. And that
status gives us the clue as to what we would like to compare: it's
simply our copy (master) and the one it's "behind" (origin/master). So
if we request:
$ git diff master origin/master
we will get a nice difference between our copy (shown in the diff with
-
) and the remote (shown with +
).
See also, these comments on stackoverflow
and the Git Cheat Sheet
Upon first install Virtualmin, you will need to set a few
configuration parameters:
- I recommend running Clam and SpamAssassin as servers, if you handle
email. If you delegate all email to a separate server, leave these
off.
We will be disabling root login to webmin / virtualmin. Start by
creating an administration group:
From the Virtualmin control panel, click at the top: Webmin
Open the webmin drop-down on the left
Click Webmin Users
Under Webmin Groups, click Create a new Webmin group
Call it "admins" or "devel" or as you wish. There is a Select All
link at the bottom of the list of permissions; use it.
Back on the Webmin User panel, click Convert Unix users to Webmin
users
Click in the radio-button for "Users with group" and put "wheel"
into the box (see previous post, where we set our administrator
users into the wheel group)
The default should be to use Unix authentication for the Webmin users.
That means, resetting your Unix password will update your Webmin login
as well.
Logout of Webmin and then back in with your username. Go back to Webmin
Users and click on the 'root' user in the list of users. Set the
password to "No password accepted" and voilá, your Webmin is now a
little more secure.
Disabling Unused Cronjobs
CentOS in particular puts unwanted tasks in the cron entries. They do
not appear in the 'crontab' proper but in /etc/cron.daily and
/etc/cron.hourly. Rename these files to be their hidden dotfile
equivalents:
cron.daily/.00webalizer
cron.daily/.freshclam
cron.daily/.makewhatis.cron
cron.hourly/.awstats
Otherwise, awstats will run every hour for every domain, regardless of
the settings you make in Virtualmin. Also I disabled 'makewhatis'
'webalizer' and 'freshclam' as I am not using them.