January 15, 2013
No Comments
Recently I setup a machine with Linux Mint.
One of the things that was I needed to install was an up to date version of Sun Java. However, for various reasons, this no longer appears in the official repos.
Thankfully there is a different repo available here http://www.duinsoft.nl/packages.php?t=en where you can download the latest version and ensure that it is updated
December 12, 2012
5 Comments
I upgrade my laptop to the latest release of Linux Mint 14 MATE edition. Everything is working beautifully apart from the wireless which, whilst functional, was cripplingly slow.
After a load of searching and testing, the solution that worked for me was:
sudo -s
iwconfig wlan0 rate 54M
echo "options ath9k nohwcrypt=1" > /etc/modprobe.d/ath9k.conf
reboot
If you copy and paste the above into a terminal it will force the wifi speed to 54M and will make sure hardware crypt is disabled and finally reboot your machine.
I did this and my wifi speed is now perfectly fast, I’m a happy bunny
linux, By:
Joseph Edmonds
5 Comments
Tags:
,
12.10,
ath9k,
ifconfig,
issue,
linux,
mint,
nohwcrypt,
problem,
slow,
solution,
ubuntu,
wifi,
wireless,
wlan0
November 19, 2012
No Comments
What is Wget in general ?
Wget is a free utility for non-interactive download of file from the web. The user doesn’t need to login system every time Wget can download the entire web page or mirroring the entire web page. If download crashed or stop for various reason Wget will start download again from where it stopped. It is highly recommended for downloading file from web with slow network connections.
How to Use Wget ?
wget -t 10 www.google.com
If network connection fails Wget will to try to reconnect 20 times in default.With -t command we can specify how many times it need to reconnect.
wget -p --convert-links -r www.google.com -o logfile
This command will download the site -p and –convert will make sure all linked files are linked to downloaded document such as images and external links it enables complete offline viewing. Log file can be enabled with -O command to view the output message.
wget --spider --force-html www.google.com
–spider Will check the webpage is existent or not.
–force It will enforce the file type that have to be downloaded.
wget -u mozilla www.google.com
some site access allowed to certain user agents. So to access with certain user agent you can use this command.
Ftp connection download is achieved by
wget -r ftp://username:password@ftp.example.com
linux, By:
daya
No Comments
Tags:
bash,
filedownload,
ftp,
http,
linux,
remote,
server,
tip,
website,
wget
November 7, 2012
No Comments
This is a very small tip, but one that can really save accidents in the long term.
To display the current branch in git simply add the following to your .bashrc in your home directory :
__git_ps1 ()
{
local b="$(git symbolic-ref HEAD 2>/dev/null)";
if [ -n "$b" ]; then
printf " (%s)" "${b##refs/heads/}";
fi
}
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\$( __git_ps1 ) \$\[\033[00m\] "
This is based on the Linux Mint prompt so is nicely coloured as well.
November 5, 2012
No Comments
What is Rsync in general ?
Rsync works like the rcp command in linux. It is used to copy files across machines. It uses efficient checksum algorithm that looks for modified files by time and size. It is used for two purposes:
Backup
Rsync is used to transfer file from the local to a remote machine. By default Rsync will use rsh, however you can instead use ssh for high security. Compressed files are transferred to save file transfer time and reduce the load on the network. It helps to transfer bulk files in minutes.
Mirroring
Rsync can synchronize file between two servers location(i.e) local and remote. By using the checksum algorithm it updates local files only if it is updated in remote server.
How to use Rsync
rsync -avze ssh -p2020 root@server.com:/sitepath/files /localdata
This command transfer files from remote server to local machine.
a Archive. It is denotes all related files and documents.
v Verbose.It will display status message as it is processing.
z Compression.It achives better compression ratio.
e It allows to chose alternative remote shell program for communication.
rsync -avze ssh -p2020 --exclude home/var/cache root@server.com:/sitepath/files /localdata
This command will transfer files from remote server to local machine by excluding cache folder.
rsync -avz /sitepath/files root@server.com:/localdata
This command will transfer all file from local to remote server. It is uses default remote shell protocol.
linux, By:
daya
No Comments
Tags:
bash,
filesystem,
internet,
linux,
localhost,
rcp,
remote,
rsh,
rsync,
scp,
server,
sh,
ssh,
unix
September 17, 2012
No Comments
So sometimes you might have a restored backup without the correct permissions (whether that be because the backup didn’t store the permissions, the file system refused to take them, or you simply forgot to add the -p flag to tar!) and you want to copy the permissions from one machine to another.
Here’s a little script to do just that that we found whilst browsing the internet to do just that (uses perl and find) :-
find / -type f -o -type d 2>/dev/null | while read FILE; do perl -le'
printf "chmod %o \"%s\"\n", 07777 & (stat)[2], $_
for @ARGV
' "$FILE"; done > /tmp/file_perms.sh
If you run that on the server with the correct permissions, then transfer the file to the server with the wrong permissions and run the file with the following command, it will fix the perms on that server :-
sh /tmp/file_perms.sh
Which may save a lot of transfer time restoring a new backup.
September 5, 2012
No Comments
One of the things that has not yet been fixed in mate is that the physical calculator button available on a lot of keyboards is mapped to “gcalctool” still but mate calls this “mate-calc”
A quick and easy fix is to ensure you have a bin folder inside your home directory (e.g. /home/edmondscommerce/bin/ ) and run the following commands at a shell :-
cd ~/bin
ln -s <code>which mate-calc</code> gcalctool
This means that anything that calls gcalctool will call mate-calc by default. The bin directory has to exist at login time to be added to the path so you may have to log out and back in to enable it.
If you have gnomey habits like pressing Alt+F2 and typing “gedit” you might find the following few aliases are handy too :-
ln -s <code>which caja</code> nautilus
ln -s <code>which pluma</code> gedit
ln -s <code>which evince</code> atril
ln -s <code>which eog</code> eom
With the Gnome world moving on to Gnome Shell and Unity some of us are finding frustrating the lack of ability to tweak and configure afforded to us by Gnome 2. MATE has gone a long way to ensuring that we can continue to use the familiar desktop environment without the worry of using an outdated and insecure version of your favourite distribution.
One such area where an immense ability to configure our DE is Compiz which is no longer compatible with Gnome Shell. Using Compiz with MATE requires a little tweaking for it to work, but ultimately is as functional as it’s always been.
Setting configurations
compiz --replace
Because Compiz is installed out of the box on Mint 13 (Maya), this does work. However you’ll find yourself with ugly window decoration which doesn’t fit in with your windows.
mateconf-editor
Navigate to /desktop/mate/session/required_components/windowmanager and set the value to compiz
gconf-editor
Navigate to /apps/metacity/general/theme and set the value to your Metacity theme name. Mint’s default is Mint-X
Setting up Compiz plugins
You might find you need to tell Compiz to use the new Window Decorator. In CompizConfigSettingsManager you’ll need to set the same into the Window Decoration plugin. Set the Command field to marco –replace
You’ll need to enable some other Window Manager must-haves in the following plugins: Move Window, Resize Window, Grid and Application Switcher for alt+tab
This should be enough to get you going – I have the Scale plugin working (for ExposĂ© style window switching)
It’s still a little rough around the edges – here’s a few issues I still have, with solutions:
Compiz occasionally crashes on MATE
Switch to another tty (Ctrl+Alt+F1) and run
marco --replace -d 0:0
Once back in your X display, run alt+F2 and run compiz –replace again
Workspace switching doesn’t work in MATE
Set the amount of workspaces you’d like in CCSM General Options Desktop Size. Set your Horizontal Virtual Size and set Vertical Virtual Size to 1
Set your panel’s workspace switcher to Number of Workspaces: 1
September 4, 2012
No Comments
If you have incremental backup requirements but would rather avoid something heavy and perhaps over featured and complex such as Bacula then Backup2L could be just the thing.
Written in BASH, it comprises only a small number of files that you can read directly to see how it works.
There is a configuration file that is installed to /etc/backup2l which you will need to edit a little and then after that its just a case of running
backup2l -b
to initiate your backups.
If you need to restore something the process is just
backup2l --restore [file_grep]
Where the file grep is a pattern to find the files you need.
It is actually very simple to set up, just hit the man page.
August 30, 2012
No Comments
If you have a long running script that is designed to run as cron but may be run manually from the terminal then you may want to enforce screen so that the process can’t be aborted by the SSH terminal being closed for whatever reason.
We already blogged about how to force running as screen here.
This is an extension of this that also checks for running as Cron and if so, does not force screen.
# First off, ensure running from Cron and if not, Screen
if [ -t 1 ]
then
echo "Not running as Cron Task"
if [ -n "$STY" ];
then
echo 'We are inside screen, good';
else
echo "Not in a screen, please run with screen"
echo "Exiting"
exit 1
fi
else
echo "Running as Cron Task"
fi
Simply paste this somewhere close to the top of your script before it does anything and this will work nicely.
linux, By:
admin
No Comments
Tags:
bash,
cron,
force,
linux,
long,
running,
screen,
script,
scripting,
ssh,
task,
terminal,
tip