Problem: You want to have backups of your huge website, but only new and changed, and yet have some way to recover any point in time restore of files. Meanwhile, you don't really want to have multiple entire site backups. Further, you only really have ftp access to download the website.
Solution: So, here's what you can do...
wget -r -N ftp://username:password@yoursite.com
git add .
git commit -m "daily backup"
Basically, browse and no-clobber files (update if timestamp is newer) and then add and commit to a git repository.
wget will only grab new files, git add will only add new files, and git commit stores the status of your folder structure with the new changes.
git log will show you your transaction history and you can git checkout any previous backup.
Tuesday, December 10, 2013
Friday, October 25, 2013
Here-doc literal @ (at symbol)
So, you have a here-doc/heredoc and need a literal @ at symbol for things like email addresses.
Answer: Replace it with \100.
Answer: Replace it with \100.
Friday, October 11, 2013
3CXPhone dial from web page
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\dial] @="URL:Dial Protocol" "EditFlags"="hex:02,00,00,00" "URL Protocol"="" [HKEY_CLASSES_ROOT\dial\DefaultIcon] @="C:\\Program Files (x86)\\Microsoft Lync\\Communicator.exe,0" [HKEY_CLASSES_ROOT\dial\shell] [HKEY_CLASSES_ROOT\dial\shell\open] [HKEY_CLASSES_ROOT\dial\shell\open\command] @="\"c:\\Program Files (x86)\\3CXPhone\\3CXPhone.exe\" %1"So, copy that, put it in a .reg file, import it.
(NOTE THIS MODIFIES YOUR REGISTRY) Determine if you want to do this.
Now, if you have a link that says:
<a href="dial:8005551212">8005551212</a>
3cxPhone will dial that link.
8005551212
Tuesday, July 9, 2013
Network Choices Windows
With Vista/Win7/8, you get the awful choice of Public/Work/Home for the *network* that you connect to.
Unfortunately, this is easily confusing to people who read "Public/Work/Home" for the *computer* that they're using. As in, the first thing that one might think about re: "Public" is that they want their computer to be *Public* (See me!) rather than private (I want to be hidden).
Frankly, I think this is a better question to ask... "You are on a new network. Do you want your computer to be Public (people can see and connect to your computer) or Private (people can't see your computer)." And that's about it.
It takes the ambiguity away ... I realize this argument can be presented in the other manner, but I'm writing this from a perspective of working with people who honestly don't understand computers in the way that I do, and if I, the computer guy, can comprehend this confusion on the users' behalf, I don't think it's an unreasonable position to state. A user who doesn't know the difference between a network and a computer can't be asked what to do on their network.
Unfortunately, this is easily confusing to people who read "Public/Work/Home" for the *computer* that they're using. As in, the first thing that one might think about re: "Public" is that they want their computer to be *Public* (See me!) rather than private (I want to be hidden).
Frankly, I think this is a better question to ask... "You are on a new network. Do you want your computer to be Public (people can see and connect to your computer) or Private (people can't see your computer)." And that's about it.
It takes the ambiguity away ... I realize this argument can be presented in the other manner, but I'm writing this from a perspective of working with people who honestly don't understand computers in the way that I do, and if I, the computer guy, can comprehend this confusion on the users' behalf, I don't think it's an unreasonable position to state. A user who doesn't know the difference between a network and a computer can't be asked what to do on their network.
Tuesday, May 7, 2013
Saturated Fat?
NOTE: I AM NOT A NUTRITIONIST. Please consult people you trust about things related to your health.
The common refrain: "This fat is bad for you because it's solid at room temperature".
About this: If your body is room temperature, you don't really have to worry about the fat being solid in your system.
Or, to put it another way: your body is probably going to like squishy things going through its system much better than things that dry it out. Squishy things are easier to push through than rough things and are easier to absorb nutrients from than fibrous items.
Have you heard of saturated fat? What do you suppose the fat is saturated with? Could it possibly be things your body needs? "Cholesterol!!!" Yes, but your body needs cholesterol to actually build cells and think better.
Why is juicing better than eating raw vegetables? Because it changes rough stuff to squishy stuff.
The common refrain: "This fat is bad for you because it's solid at room temperature".
About this: If your body is room temperature, you don't really have to worry about the fat being solid in your system.
Or, to put it another way: your body is probably going to like squishy things going through its system much better than things that dry it out. Squishy things are easier to push through than rough things and are easier to absorb nutrients from than fibrous items.
Have you heard of saturated fat? What do you suppose the fat is saturated with? Could it possibly be things your body needs? "Cholesterol!!!" Yes, but your body needs cholesterol to actually build cells and think better.
Why is juicing better than eating raw vegetables? Because it changes rough stuff to squishy stuff.
Wednesday, May 1, 2013
Solve AutoMySQLBackup warning mysql.event
Fix for: -- Warning: Skipping the data of table mysql.event.
Specify the --events option explicitly.
edit /usr/sbin/automysqlbackup (wherever your /etc/cron.daily/automysqlbackup points)
find the OPT="--quote-names" line (about line 354)
Change it to
OPT="--quote-names --events --ignore-table=mysql.event"
OR, (Based upon additional reading of responses):
one of:
OPT="--quote-names --events"
OPT="--quote-names --ignore-table=mysql.event"
The original line suppresses the warning and ignores the table (redundant).
If you wish to have the table in your backup, don't ignore the table, just use --events
If you don't care about the table, ignoring the table will also suppress the event message.
What's optimal? Depends on if you use events and require them to be restored.
http://dev.mysql.com/doc/refman/5.1/en/events-table.html
Reference: http://bugs.mysql.com/bug.php?id=68376
edit /usr/sbin/automysqlbackup (wherever your /etc/cron.daily/automysqlbackup points)
find the OPT="--quote-names" line (about line 354)
Change it to
OPT="--quote-names --events --ignore-table=mysql.event"
OR, (Based upon additional reading of responses):
one of:
OPT="--quote-names --events"
OPT="--quote-names --ignore-table=mysql.event"
The original line suppresses the warning and ignores the table (redundant).
If you wish to have the table in your backup, don't ignore the table, just use --events
If you don't care about the table, ignoring the table will also suppress the event message.
What's optimal? Depends on if you use events and require them to be restored.
http://dev.mysql.com/doc/refman/5.1/en/events-table.html
Reference: http://bugs.mysql.com/bug.php?id=68376
Friday, April 26, 2013
Keep your vim plugins up to date
Scenario:
You go and download a plugin from a website but the website says, "Check GitHub for the most uptodate version."
So you get the tarball or the file you need and all is good. If you're okay with this, stop reading. You don't need to know the rest.
Method 1:
cd ~/.vim
mkdir gits
cd gits
git clone https://github.com/user/pluginname.git
ln -s ~/.vim/gits/pluginname/plugin/something.vim ~/.vim/plugin/something.vim
ln -s ~/.vim/gits/pluginname/doc/something.txt ~/.vim/doc/something.txt
ln -s ~/.vim/gits/pluginname/autoload/something.vim ~/.vim/autoload/something.vim
(if it exists -- editorconfig, for example)
Check also for plugin/python folders for your plugins.
Yes, I realize this is a bit more painful than just extract/install, but only slightly.
Now, if you want the latest update from the plugin, you can
cd ~/.vim/gits/pluginname/
git pull
Method 2:
cd ~/.vim
git init
mkdir gits
git submodule add https://github.com/user/pluginname.git gits/pluginname
now do the linking.
This second method allows you to version your changes across the entire .vim folder.
You also can checkout specific branches of the plugin, etc.
You go and download a plugin from a website but the website says, "Check GitHub for the most uptodate version."
So you get the tarball or the file you need and all is good. If you're okay with this, stop reading. You don't need to know the rest.
Method 1:
cd ~/.vim
mkdir gits
cd gits
git clone https://github.com/user/pluginname.git
ln -s ~/.vim/gits/pluginname/plugin/something.vim ~/.vim/plugin/something.vim
ln -s ~/.vim/gits/pluginname/doc/something.txt ~/.vim/doc/something.txt
ln -s ~/.vim/gits/pluginname/autoload/something.vim ~/.vim/autoload/something.vim
(if it exists -- editorconfig, for example)
Check also for plugin/python folders for your plugins.
Yes, I realize this is a bit more painful than just extract/install, but only slightly.
Now, if you want the latest update from the plugin, you can
cd ~/.vim/gits/pluginname/
git pull
Method 2:
cd ~/.vim
git init
mkdir gits
git submodule add https://github.com/user/pluginname.git gits/pluginname
now do the linking.
This second method allows you to version your changes across the entire .vim folder.
You also can checkout specific branches of the plugin, etc.
Subscribe to:
Posts (Atom)