Tag-Archive for » zálohování «

Sobota, 21.února, 2009 | Autor:

Relativně nové typy dokumentů Kancelář 2007 dal několik internetových hostitelů problémy, když jejich klienti chtějí nabídnout podklady pro stažení. Nejčastěji, Dokumenty, které jsou nabízeny prostřednictvím webového serveru jako “text / html” který je pak vykreslen jako tuny odpadu na obrazovce webového uživatele.

Nejlepší způsob, jak vyřešit tento problém je přidat všechny MIM Typy na hlavní konfigurace serveru. IIS7 pro Windows již má tyto typy MIME správně nastavit jako výchozí. IIS6 a IIS5 vyžadují typy MIME, které mají být přidány, jak se dalo Apache Na starších instalacích. Apache, tam je také řešení pro jednotlivé majitele domény přidat typy MIME pomocí Apache je .htaccess soubor.

IIS 6 MIME typ přídavek (pro Server Administrator)

Předtím, než to může být provedeno, zajistit, že váš server je nastaven tak, aby umožnit přímou editaci metabáze:

  1. Zatížení Správce služby IIS: Start -> Run, “inetmgr” -> [OK]
  2. Pravým tlačítkem myši na “Server” a klepněte na tlačítko “Properties”
  3. V rámci “Internetová informační služba” poutko (Obvykle karta pouze), zajištění toho, aby “Enschopný přímé úpravy metabáze” políčko je zaškrtnuto.
  4. Cvaknutí [OK]

Ujistěte se, že zálohování konfigurace služby IIS je (zde pro IIS5) předem. I nenese žádnou odpovědnost za admina zlomil serveru. Mám důvod se domnívat, že toto smět také pracovat na IIS5 nicméně mám jen tolik důvod se domnívat, že by to mohlo jen dát spoustu chyb. Je-li IIS5 / Windows 2000 admin je ochoten zkoušet to pro mě Po zálohování konfigurace, prosím, dejte mi vědět na výsledky.

Zkopírujte následující text do souboru s názvem msoff07-addmime.vbs a spustit jej jednou z příkazové řádky zadáním cscript msoff07-addmime.vbs a stisknutím klávesy Enter. Pokud spustíte více než jednou, typy MIME bude přidáno pokaždé, a budete mít několik identických položek:

"Tento skript dodává potřebnou úřadu 2007 Typy MIME na IIS 6 Server.
"Chcete-li použít tento skript, stačí poklepat nebo ji spustit z příkazového řádku.
"Spuštění tohoto skriptu několikrát za následek více položek v uživatelské
"IIS MimeMap takže byste neměli spouštět více než jednou.
"Modifikovaná z http://msdn.microsoft.com/en-us/library/ms752346.aspx
 
Ztlumit MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec
const ADS_PROPERTY_UPDATE = 2 
 
"Nastavit typy MIME, které mají být přidány
MimeTypesToAddArray = řada(".docm", "application/vnd.ms-word.document.macroEnabled.12", _
".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", _
".dotm", "application/vnd.ms-word.template.macroEnabled.12", _
".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", _
".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12", _
".potx", "application/vnd.openxmlformats-officedocument.presentationml.template", _
".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12", _
".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", _
".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", _
".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12", _
".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation", _
".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12", _
".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide", _
".xlam", "application/vnd.ms-excel.addin.macroEnabled.12", _
".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12", _
".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12", _
".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", _
".xltm", "application/vnd.ms-excel.template.macroEnabled.12", _
".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template") 
 
"Získat objekt mimemap
Soubor MimeMapObj = GetObject("IIS://Localhost / MimeMap")
 
"Výzva AddMimeType pro každou dvojici prodloužení / typu MIME
Pro čelit = 0 na UBound(MimeTypesToAddArray) Krok 2
    AddMimeType MimeTypesToAddArray(čelit), MimeTypesToAddArray(čelit+1)
další
 
"Vytvoření objektu Shell
Soubor WshShell = CreateObject("WScript.Shell")
 
"Zastavení a spuštění služby IIS
Soubor oExec = WshShell.Exec("net stop w3svc")
Dělat Zatímco oExec.Postavení = 0
    WScript.Spát 100
Smyčka
 
Soubor oExec = WshShell.Exec("net start w3svc")
Dělat Zatímco oExec.Postavení = 0
    WScript.Spát 100
Smyčka
 
Soubor oExec = Nic
 
"Zpráva o stavu pro uživatele
WScript.Echo "Microsoft Office 2007 typů dokumentů MIME byly zaregistrovány."
 
"AddMimeType Sub
Sub AddMimeType (ext, MTYPE)
 
    "Get mapování z objektu MimeMap.
    MimeMapArray = MimeMapObj.GETEX("MimeMap") 
 
    "Přidání nového mapování.= UBound(MimeMapArray) + 1
    ReDim zachovat MimeMapArray()
    Soubor MimeMapArray() = CreateObject("MimeMap")
    MimeMapArray().Rozšíření = ext
    MimeMapArray().MimeType = MTYPE
    MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
    MimeMapObj.SetInfo
 
End Sub

Apache MIME type addition (pro Server Administrator)

Apache stores its MIME types in a file normally located at $installpath/conf/mime.types. See the mod_mime documentation for more on how it works. Arch Linux installs its MIME types at /etc/httpd/conf/mime.types a Parallels Plesk installs it in /usr/local/psa/admin/conf/mime.types. Your distribution might have it in another place, so find your mime.types file by running locate mime.types.

Add the following lines to your mime.types file:

application/vnd.ms-word.document.macroEnabled.12                          docm
application/vnd.openxmlformats-officedocument.wordprocessingml.document   docx
application/vnd.ms-word.template.macroEnabled.12                          dotm
application/vnd.openxmlformats-officedocument.wordprocessingml.template   dotx
application/vnd.ms-powerpoint.template.macroEnabled.12                    potm
application/vnd.openxmlformats-officedocument.presentationml.template     potx
application/vnd.ms-powerpoint.addin.macroEnabled.12                       ppam
application/vnd.ms-powerpoint.slideshow.macroEnabled.12                   ppsm
application/vnd.openxmlformats-officedocument.presentationml.slideshow    ppsx
application/vnd.ms-powerpoint.presentation.macroEnabled.12                pptm
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/vnd.ms-powerpoint.slide.macroEnabled.12                       sldm
application/vnd.openxmlformats-officedocument.presentationml.slide        sldx
application/vnd.ms-excel.addin.macroEnabled.12                            xlam
application/vnd.ms-excel.sheet.binary.macroEnabled.12                     xlsb
application/vnd.ms-excel.sheet.macroEnabled.12                            xlsm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet         xlsx
application/vnd.ms-excel.template.macroEnabled.12                         xltm
application/vnd.openxmlformats-officedocument.spreadsheetml.template      xltx

Apache MIME type addition (For the domain owner with at least FTP accessusing .htaccess file)

Add the following text to your domain’s .htaccess soubor, most commonly in an httpdocs/ directory

AddType application/vnd.ms-word.document.macroEnabled.12 docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.ms-word.template.macroEnabled.12 dotm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-powerpoint.slide.macroEnabled.12 sldm
AddType application/vnd.openxmlformats-officedocument.presentationml.slide sldx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
Podíl
Čtvrtek, January 01st, 2009 | Autor:

Podle všeho, what operating system you use can say a lot about you. If you’re using some form of *nix, který distro you’re using can say a lot as well. Redundancy aside, I believe that a Linux distribution depends absolutely on its package management and distribution system.

I liked apt-get (1, 2) but there was some technical problem at some point and it caused me to use schopnost místo toho. Using aptitude is slightly easierit has more features automated into single, logical, commands where apt-get requires separate commands. Aptitude also has a curses-based GUI. If you’re not using the GUI then, other than brevity in terms of number of commands to learn, there is apparently no technical reason to prefer one over the other. Aptitude and apt-get serve K/X/Ubuntu a Debian dobře. From this point, I use the names Kubuntu and Ubuntu in a loosely interchangeable fashion.

In my use of CentOS (based on Red Hat), I’ve found I like yum. It seems to work in much the same as aptitudeone command to rule them all. It has some rather annoying default behaviour I’m not going to get into here as its most likely because I’m just not used to it. At least from a technical perspective, it is very good. I believe that Fedora also makes use of yum though my experience with Fedora is very limited.

the theory

Fedora and Ubuntu are in a class of distributions that have a fairly rigorous release cycle. Ubuntu 8.10 (the version is named so for the year and month of its release) nebude, except for major bugs and minor changes, have another major update until the next version, Jaunty Jackalope. Ubuntu users have the latest versions of most software on their desktops right now. In the months preceding the next release, however, they’re not going to be so lucky unless they like using “beta” releases. As I’m not very familiar with Fedora, I’m not going to bother going into its release cycle.

These 2 distributions are also within a class of distributions known asbinary” nebo “binary-baseddistributions. This means that when you download an update, the files that are downloaded are precompiled and should run on anysupportedhardware. This isn’t specifically optimised for your desktop’s hardware, například, tvůj processor. Perhaps you have an AMD processor which has extra instruction support which Intel CPUs do not have. The reverse could also be true. Z tohoto důvodu, a binary-release distribution cannot optimise for one particular brand of hardware. Regardless of thisnon-optimisation”, it should run at a decent pace.

the practice!

O 2 years ago I started using Kubuntu. After a few months of working with it, I started to learn more about its specifics. I’m not much of a fan of using GUI tools to update the system when, ultimately, its all happening on the command-line anyway. The GUI tools just hide the complexity I don’t mind seeing.

I ended up making a praštit skript, update, which would run all the steps required to get aptitude to just go ahead and upgrade already, kthx?©, perhaps stopping along the way to back up my configuration, remount the NFS network share where we keep an on-site repository, back up the local cache of aptitude’s installed packages, do some folder-link shuffling to use a local copy if the network share couldn’t remount, sync between the local copy and the network share if the previous update had a network share issue, and update lists of packages in the repository. In general, it wouldn’t go ahead if there were any errors though, as you can tell, this script became a messy beast that went above and beyond the original requirements. It worked well for me.

Until the day came to update between Kubuntu 6.10 na 7.04. I did this manually though, not with the script.

I ended up reinstalling from scratch as a result of the mess that ensued. At least, as a backup administrator should do well to demonstrate, it was easy to recover everything I really needed. 🙂

What else is out there?

Even before I had to reinstall Kubuntu, I was introduced to another distribution called Gentoo. There are 2 very distinct differences between Gentoo and Ubuntu’s update system. The first is that Gentoo is a source-based distribution. This means that when you update a package, the package manager downloads the source and compiles everything, hopefully optimising it for tvůj system. Tento, I think, is very cool. The downside to this is that compiling everything takes a very long time.

Here are my (very unscientific) estimates for the length of time it takes to install a basic GUI OS to a desktop from installation media, excluding extraneous drivers (například, the latest 3D graphics drivers):

OS: minmax (median)

Windows Vista: 15 – 30 (20) minutes

Ubuntu: 15 – 40 (20) minutes

Gentoo: 3 – 40 (6) hours

Gentoo also requires much tinkering with the config files in order to get things workingthis is another reason for the extremely long delay between inserting the CD and booting your awesome* new desktop. Popular applications have binary packages available for downloadthough this isn’t a default option.

They see me rollin

There is one more very important distinction Gentoo has from most other distributions. It is arolling-releasedistribution. This means that there isn’t any rigorous version orreleasethat the distribution adheres to. If you install Gentoo todayif you finish installing Gentoo today, you’re probably going to have the latest version of all the applications you installed. If some obscure application gets a major update tomorrow, within a few days, if you update your system, you’re going to have that latest version on your desktop.

The difference between this rolling release and theotherdistributions is rather staggering. Například: If KDE 4.2 were to be released tomorrow, you’d probably have to wait less than 2 weeks for it to be available on Gentoo. Ubuntu users might have to wait till 9.04 – that’s a 4-month wait.

Something more suitable?

Osobně, I’m not willing to put in the 40 hours of effort to get my system working the way I want it to. My colleague had to reinstall recently for some obscure reason and it turns out he wasn’t willing to put in the 6 hours (he’s more experienced with Gentoo) of effort to get his system back to how it was running either. Instead, Arch Linux caught his eye. Arch Linux is a rolling-release (like Gentoo), binary-based (like Ubuntu) distribution. Its packages (dobře, the vast majority of them) don’t need much tinkering with their config files to get things working nicely either. Its the best of both worlds!

You still need to know what you’re doing* but if you’ve come to this juncture, it shouldn’t be such a giant leap of faith. Arch Linux’s package manager, called pacmuž, has built-in dependency and conflict handling. I use another package manager, jogurt (French for yoghurt), which has very quickly become popular with Arch users. Yaourt enhances the functionality of pacman by allowing you to download and install applications directly from the AUR, nebo Arch User Repository. This repository contains scripts that allow you to automatically download and install many applications that would otherwise be completely unsupported by Arch’s own core developers. It downloads and compiles the package into a chroot’d environment. It then packages the chroot’d environment into a pacman-compatible package tarball and uses pacman to deploy it into your system.

Také, the AUR supports a voting system whereby popular packages get placed into the more official [community] repository. Yaourt also supports an automated voting mechanism whereby, after installing a package via AUR, it asks if you want to vote for its inclusion in [community].

I estimate that the time taken for my Arch installation was about 90 minutes. I don’t recommend Archlinux for newbies though I dělat recommend it for any Linux user who’s gotten bored with other distrosand wants to get into the nitty gritty without having to install Linux From Scratch. Arch Linux has been getting pretty popular these days. Its currently at number 14 na Distrowatch.

* IF you know what you’re doing. AND YOU BETTER BLOODY KNOW WHAT YOU’RE DOING!
Podíl
Tuesday, December 09th, 2008 | Autor:

To fail at failing. I recently came across a discussion where a user was advised to run a fail command. The result was, luckily, as follows:

[user@user-desktop ~]$ cd ~/.Trash; sudo rm -rfv *
praštit: cd: /home/user/.Trash: No such file or directory
bash: sudo: command not found
[user@user-desktop ~]$

The command cd ~/.Trash Changes the directory (nebo present working directory) to the /home/user/.Trash folder. V tomto případě, this folder doesn’t exist and so the pwd stays as /home/user/, the folder where vše the user’s files and settings are saved.

The command rm -rfv * removes all files in the pwd. Thevpart indicates that it must show verbose output indicating what is being done during this removal process. The prefixed command sudo (substitute user dělat) has the command run as root. Tedy, had the sudo command been functional, user would have deleted every document he had ever saved in his home folder.

Word of advice from a backup admin: backup often. 😉

Podíl