Moed Katan3: 4
אֵין כּוֹתְבִין שְׁטָרֵי חוֹב בַּמּוֹעֵד. וְאִם אֵינוֹ מַאֲמִינוֹ, אוֹ שֶׁאֵין לוֹ מַה יֹּאכַל — הֲרֵי זֶה יִכְתֹּב.  אֵין כּוֹתְבִין סְפָרִים, תְּפִלִּין וּמְזוּזוֹת בַּמּוֹעֵד, וְאֵין מַגִּיהִין אוֹת אַחַת, אֲפִלּוּ בְסֵפֶר (עֶזְרָא) [הָעֲזָרָה]. רַבִּי יְהוּדָה אוֹמֵר: כּוֹתֵב אָדָם תְּפִלִּין וּמְזוּזוֹת לְעַצְמוֹ, וְטֹוֶה עַל יְרֵכוֹ תְּכֵלֶת לְצִיצִיתוֹ.
We may not write loan contracts during [Chol] HaMoed. However, if he does not trust him, or if he has nothing to eat, then he may write.  We may not write Books [of Scripture], nor tefillin, nor mezuzos during [Chol] HaMoed. We may not correct a single letter even in the [Torah] scroll of the Temple court. R' Yehudah says: A person may write tefillin or mezuzos for his personal use; and he may spin the blue thread for his tzitzis, on his thigh.
Moed Katan3: 5
הַקּוֹבֵר אֶת מֵתוֹ שְׁלֹשָׁה יָמִים קֹדֶם לָרֶגֶל — בָּטְלָה הֵימֶנּוּ גְּזֵרַת שִׁבְעָה. שְׁמוֹנָה — בָּטְלָה הֵימֶנּוּ גְּזֵרַת שְׁלֹשִׁים, מִפְּנֵי שֶׁאָמְרוּ: שַׁבָּת עוֹלָה וְאֵינָהּ מַפְסֶקֶת, רְגָלִים מַפְסִיקִין וְאֵינָן עוֹלִין.
He who buries his dead [relative] three days before a festival has the edict of seven [days of mourning] annulled. [He who buries his dead relative] eight [days before a festival] has the edict of thirty [days of mourning] annulled. [This is so] because they said: Sabbath is included [in the period of mourning] but does not interrupt [it]. Festivals [however] interrupt but are not included.