OpenLLM-France/wikimedia huggingface dataset:
# LMIs in Control/Discrete-Time Systems/Discrete-Time H2-Optimal Observer

LMIs in Control/Discrete-Time Systems/Discrete-Time H2-Optimal Observer

## The System

    ${\begin{aligned}x_{k+1}&=A_{d}x_{k}+B_{d1}w_{k},\\y_{k}&=C_{c2}x_{k}+D_{d21}w_{k}\\\end{aligned}}$
Where it is assumed that :$(A_{d},C_{d2})$ is detectable.

## The Data

The matrices $A_{d},B_{d1},C_{cd2},C_{cd1},D_{d21}$.

## The Optimization Problem

An observer of the form:
    ${\begin{aligned}{\hat {x}}_{k+1}&=A_{d}{\hat {x}}_{k}+L_{d}(y_{k}-{\hat {y}}_{k}),\\{\hat {y}}_{k}&=C_{d2}{\hat {x}}_{k}\\\end{aligned}}$
is to be designed, where $L_{d}\in R^{n_{x}\times n_{y}}$ is the observer gain.
Defining the error state $e_{k}=x_{k}-{\hat {x}}_{k}$, the error dynamics are found to be
$e_{k+1}=(A_{d}-L_{d}C_{d2}e_{k}+(B_{d1}-L_{d}D_{d21})w_{k}$,
and the performance output is defined as
$z_{k}=C_{d1}e_{k}$.
The observer gain $L_{d}$ is to be designed such that the $H_{2}$ of the transfer matrix from $w_{k}$ to $z_{k}$, given by
$L_{d}{\begin{aligned}T(z)&=C_{d1}(z1-(A_{d}-L_{d}C_{d2}))^{-1}(B_{d1}-L_{d}D_{d21}),\\\end{aligned}}$
is minimized.

## The LMI: Discrete-Time H2-Optimal Observer

The discrete-time $H_{2}$-optimal observer gain is synthesized by solving for $P\in S^{n_{x}}$, $Z\in S^{n_{z}}$, $G_{d}\in R^{n_{x}\times n_{y}}$, and $v\in R_{>0}$ that minimize $J(v)=v$ subject to $P>0,Z>0$,
       ${\begin{aligned}{\begin{bmatrix}P&PA_{d}-G_{d}C_{d2}&PB_{d1}-G_{d}D_{d21}\\*&P&0\\*&*&1\end{bmatrix}}&>0,\\{\begin{bmatrix}Z&PC_{d1}\\*&P\end{bmatrix}}&>0,\\\operatorname {tr} Z<v\end{aligned}}$

## Conclusion:

The $H_{2}$-optimal observer gain is recovered by $L_{d}=P^{-1}G_{d}$ and the $H_{2}$ norm of $T(z)$ is $\mu ={\sqrt {v}}$.

## Implementation

https://github.com/rezajamesahmed/LMImatlabcode/blob/master/Discrete_Time_H2_Optimal_Observer_LMIs_Wikibook_Example.m

## Related LMIs

Discrete-Time Mixed H2-H∞-Optimal Observer//
Discrete-Time H∞-Optimal Observer//

## External Links

A list of references documenting and validating the LMI.
* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
* LMI Properties and Applications in Systems, Stability, and Control Theory - A List of LMIs by Ryan Caverly and James Forbes.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.
# Issues in Interdisciplinarity 2018-19/Truth, History and Society: Twitter as an illustration for the current vehicle of truth
## Introduction

Social media forms such as Twitter are used for information circulation, but history shows that vehicles of information are limited by leading to disinformation.Truth is understood as an issue in this chapter because the institution or person in power to influence the public can easily deform the truth and create disinformation. Disinformation is all the communication techniques used to deliberately to mislead the public eye, usually to serve personal interest. The UNESCO refers to it as ‘deliberately created to harm’.
History has shown that, in certain circumstances, historical vehicles of truth we will focus on such as the Christian Church and national governments are guilty of disinformation when it serves their interest or principles. This historical issue of disinformation is even more relevant today with social media. We will use history to address the issue of disinformation and focus on the social media Twitter to prove it relevance in the 21st century.
# Mandarin Chinese Grammar for Pimsleur Students/Adjectival stative verbs

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Adjectival stative verbs

Adjectives function as verbs. Thus, an adjective like 高, which means "tall/high," needs no copula in the sentence "他高," which means "he is big." One can interpret 高 in this sentence as "to be tall." If one uses the copula 是 before an adjective, it creates a sense of confirmation. Normal prosody makes 是 take phonetic stress in this usage. For example, "他是高" means "he is tall."
Often, the adverb 很 (very) is placed immediately before an adjective. Though 很 means "very," it is not as strong a word as "very" in English, as it is very often used only to improve the flow of a sentence and not actually to stress that the adjective applies to a great extent.
All adjectives can be used as verbs. This page gives some examples of common adjectives.

### Examples

| 好 | hăo | good, well |
| 多 | duō | much, many | 我的太太有很多美金 ◦ | wŏde tàitai yŏu hěn duō měijīn. | My wife has a lot of dollars. |
| | | | 不是很多 ◦ | bù shì hěn duō. | It isn’t very much. |
| | | | 女儿很多 ◦ | nǚér hěn duō . | That’s a lot of daughters. |
| | | | 他们的家人很多 ◦ | tāmen de jiā rén hěn duō. | They have a big family. |
| 贵 | guì | expensive |
| 快 | kuài | quick |
| 大 | dà | big |
| 小 | xiăo | small |
| 远 | yuăn | far |

### Syntax

Mandarin syntax follows a default SVO (Subject-Verb-Object) word order, as in English. Indirect objects are placed before the object in Mandarin. (This is not true for some other Chinese languages, like Cantonese.) For example, "give me water" is "给我水." Since adjectives function as verbs, they occupy the V role in a sentence.
# Mandarin Chinese Grammar for Pimsleur Students/Adverbs

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Adverbs
### Inclusion and Continuity

| 也 | yě | also |
| 我也想喝一点儿葡萄酒 ◦ | wŏ yě xiăng hē yìdiăn'r pútaojiŭ. | I too would like to drink some wine. |

### Intensifiers

| 很 | hěn | very |
| 很好 | hěn hăo | very good |
| 她有很多钱 ◦ | tā yŏu hěn duō qián | She has a lot of money. |
| 他们说得很快 ◦ | tāmen shuō de hěn kuài. | They speak very quickly. |
| 我的女儿很大了 ◦ | wŏ de nǚér hěn dà le. | My daughter is very grown-up. |
| 太 | tài | too |
| 太多了 | tài duō le | too much |
| 太多啤酒了 | tài duō píjĭu le | too much beer |
| 你说得太快了 ◦ | nĭ shuō de tài kuài le. | You speak too quickly. |
| 一点儿 | yìdiăn'r | a little |
| 他有一点儿钱 ◦ | tā yŏu yìdiăn'r qián. | He has a little money. |
| 他们会说一点儿国语 ◦ | tāmen huì shuō yìdiăn'r guó yŭ. | They can speak a little Mandarin. |
| 他想买一点儿东西 ◦ | tā xiăng măi yìdiăn'r dōngxi. | He would like to buy (a little) something. |

### Location

| 这儿 | zhè'er | here | 学院路不是在这儿 ◦ | Xuéyuàn lù bù shì zài zhè'er. | College Road isn't located here. |
| 那儿 | nà'r | over there | 长安街在那儿 ◦ | Cháng Ān jiē zài nà'r. | Long Peace Street is located over there. |
| 我那儿 | wŏ nà'r | my place | 去我那儿吃 ◦ | qù wŏ nà'r chī. | Let's go to my place to eat. |
| 一直往前 | yī zhí wăng qián | straight ahead | 一直往前走 ◦ | yī zhí wăng qián zŏu. | Go straight ahead. |
| 右边 | yòubiān | right | 右边那条路 | yòubiān nà tiáo lù | the road to the right |
| 左边 | zuŏbiān | left | 你应该走左边那条路 ◦ | nĭ yīnggāi zŏu zuŏbiān nà tiáo lù. | You should take the road to the left. |

### Time

| 点钟 | … diăn zhōng | at … o'clock | 我想一点钟吃午饭 ◦ | wŏ xiăng yī diăn zhōng chī wŭfàn. | I would like to have lunch at 1 o'clock. |
| 过一会儿 | guò yì huĭ'er | later | 她想过一会儿喝茶 ◦ | tā xiăng guò yì huĭ'er hē chá. | She would like to have tea later. |
| 今天 | jīntiān | today | 今天我不想吃东西 ◦ | jīntiān wŏ bù xiăng chī dōngxi. | Today, I would not like to eat anything. |
| | | | 今天晚上我要吃晚饭 ◦ | jīntiān wănshàng wŏ yào chī wănfàn. | Tonight (today in the evening), I am going to have dinner. |
| 明天 | míngtiān | tomorrow | 明天晚上八点钟 ◦ | míngtiān wănshàng bā diăn zhōng. | Tomorrow evening at 8 o'clock. |
| 晚上 | wănshàng | in the evening | 今天晚上我要吃晚饭 ◦ | jīntiān wănshàng wŏ yào chī wănfàn. | This evening, I am going to have dinner. |
| 现在 | xiàn zài | now | 现在几点钟 ? | xiàn zài jí diăn zhōng? | What time is it (now)? |
| | | | 现在一点钟 ◦ | xiàn zài yī diăn zhōng. | (Now,) it is 1 o'clock. |
| | | | 现在我钱够了 ◦ | xiàn zài wŏ qián gòu le. | Now, I have enough money. |
| | | | 我想现在吃午饭 ◦ | wŏ xiăng xiàn zài chī wŭfàn. | I would like to eat lunch now. |
# Mandarin Chinese/Sentences/What is her name
## What's her name?

In Chinese, this sentence 她叫什么名字？ is a basic interrogative sentence.什么 is the word to transfer the interrogative.This sentence can be also written as "她的名字是什么？"

## Interrogative

In chinese, those words which used in interrogative including 什么, 谁, 哪个, 哪里, and so on.
# Mandarin Chinese Grammar for Pimsleur Students/Activity verbs

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Activity verbs
### Examples

| 吃 | chī | eat | 你想吃什么 ? | nĭ xiăng chī shénme? | What would you like to eat? |
| 给 | gěi | give | 给我一点儿钱 ! | gěi wŏ yìdiăn'r qián! | Give me some money! |
| 喝 | hē | drink | 你想去哪儿喝 ? | nĭ xiăng qù nǎ'r hē? | Where would you like to go to drink? |
| 进 | jìn | enter, advance | 请进! | qĭng jìn ! | Please, come in! |
| 买 | măi | buy | 她不想买东西 ◦ | tā bù xiăng măi dōngxi. | She wouldn't like to buy anything. |
| 去 | qù | go | 你要去哪儿 ? | nĭ yào qù nǎr? | Where will you go? |
| 说 | shuō | speak | 怎么说 ? | zěnme shuō? | How do you say? |
| 问 | wèn | ask | 请问 ! | qĭng wèn! | Please, let me ask! (lit.: please ask) |
| 要 | yào | want, order | 我想要一点儿茶 ◦ | wŏ xiăng yào yìdiăn'r chá. | I would like to order some tea. |
| 走 | zŏu | walk, go | 一直往前走 ! | yī zhí wăng qián zŏu! | Go straight ahead! |
| 做 | zuò | do | 你要做什么 ? | nĭ yào zuò shénme? | What are you going to do? |

### Combination of activity verbs

Activity verbs can be combined:
| 你想去哪儿吃一点东西 ? | nĭ xiăng qù nǎr chī yìdiăn'r dōngxi? | Where would you like to go to eat something? |
# Mandarin Chinese Grammar for Pimsleur Students/Conjunctions

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Conjunctions
### Disjunction

| 还是 | háishì | or (only one alternative possible) |
| 一点钟还是两点钟 ? | yī diăn zhōng háishì liăng diăn zhōng? | At 1 o'clock or at 2 o'clock? |
| 或者 | huòzhě | or (both alternatives possible) |
| 我想买茶或者水 ◦ | wŏ xiăng măi chá huòzhě shuĭ. | I would like to order tea or water. |

### Contrast

| 可是 | kě shì | but |
| 他是中国人可是他英文说得很好 ◦ | tā shì Zhōnguó rén kě shì tā yīngwén shuō de hěn hăo. | He is Chinese, but he speaks English very well. |
# Mandarin Chinese/Sentences/I am 42

This Sentence is I am 42 years old. You pronounce it as Wǒ sìshí'èr suì.
# Mandarin Chinese/Two/你好
## Vocab

| Chinese | English | Pinyin |
| 你 | You | Nǐ |
| 好 | Good | Hǎo |
| 快乐 | Happy | Kuàilè |
| 很 | Very | Hěn |
| 我 | I, me | Wǒ |
| 他 | He, him | Tā |
| 她 | She, her | Tā |
| 不 | No, not | Bù |
| 是 | To be | Shì |
| 老师 | Teacher | Lǎoshī |
| 猫 | Cat | Māo |
| 也 | Also | Yě |
| 有 | To have | Yǒu |
| 没有 | To not have | Měiyǒu |
| 朋友 | Friend | Pěngyóu |
| 的 | 's | De |

## Grammar

* Sentences are Subject-Verb-Object
    我有朋友。- I have friends.
    她是猫。- She is a cat.
* "To Be" Sentences are (A Noun)-是-(Another Noun)
* To say "Something is _______" you use 很 instead of 是
    老师很快乐。- A teacher is happy.
* Negative sentences are formed by placing 不 before the verb or adjective
** This is different for "To Have"
    我没有朋友。
    她不是猫。
    老师不快乐。
Questions are formed in several ways, the first that shall be presented in this wikibook is the A不A pattern
* Subject-Verb-Negative form of Verb-Object
    你好不好? - How are you?
    你有没有朋友? - Do you have friends?
    她是不是猫? - Is she a cat?
    老师快乐不快乐? - Is the teacher happy?
* FInally, 的 after a noun or pronoun will make it possessive

## Dialogue
### Chinese

东尼: 你好! 艾美: 你好! 东尼: 你有没有猫? 艾美: 没有。于老师有猫。 东尼: 我也有猫。她是我的朋友。

### Pinyin

Dōngní: Nǐhǎo! Àiměi: Nǐhǎo! Dōngní: Nǐ yǒu měiyǒu māo? Àiměi: Měiyǒu. Yúlǎoshī yǒu māo. Dōngní: Wǒ yě yǒu māo. Tā shì wǒde pěngyóu.

### English

Tony: Hello! Amy: Hello! Tony: Do you have a cat? Amy: No. Teacher Yu has a cat. Tony: I also have a cat. She is my friend.
# Mandarin Chinese/Sentences/Hello
## First meet someone

"你好" means "Hello", sometimes it can be consider as "Nice to meet you". When first meet someone,Chinese native speakers usually speak in this word and used in most other senses. And 您好 is a more formal way.

## Familiar Greetings

Generally, people use kinds of words or phrases with features to ask for another when they are in a good relationship, such as "你吃了吗?". Those words are like what was used in English such as "how are you?" and "how is going?"
# Mandarin Chinese/Sentences/How are you

This sentence is How are you? It is pronounced as Nǐ hǎo ma
# Linux Guide/Runlevels
## Starting Linux (Booting)

When a computer is turned on, it normally begins the process of "booting" by reading software from the system's hard disk (or other non-volatile storage medium), and loading it into memory and then executing it. In this process the kernel is loaded and then various other system programs may be loaded.
A Linux system can be configured to boot up to one of several available "run levels":

### Debian

The following quote from The Debian GNU/Linux FAQ explains how to add a custom procedure to a Debian or Debian based system boot:
Suppose a system needs to execute script foo on start-up, or on entry to a particular (System V) runlevel. Then the system administrator should:
* Enter the script foo into the directory /etc/init.d/.
* Run the Debian command update-rc.d with appropriate arguments, to set up links between the (command-line-specified) directories rc?.d and /etc/init.d/foo. Here, '?' is a number from 0 through 6 and corresponds to each of the System V runlevels.
* Reboot the system.
The command update-rc.d will set up links between files in the directories rc?.d and the script in /etc/init.d/. Each link will begin with a 'S' or a 'K', followed by a number, followed by the name of the script. Scripts beginning with 'S' in /etc/rcN.d/ are executed when runlevel N is entered. Scripts beginning with a 'K' are executed when leaving runlevel N.

#### External links

* The Debian GNU/Linux FAQ Chapter 11 - Customizing your installation of Debian GNU/Linux
# Linux Guide/Operating modes
### Text Console Mode

When running Linux in a text console mode, the user is presented with a "command shell" and is able to type commands and have the system respond appropriately. In this example text console interaction, the user has typed the command "date" and the date and time was then displayed:
In many cases, accessing a system in text console mode may be more appropriate than running a GUI system. Often, such systems are operating as "servers", examples of which include web servers or database servers. Servers are not normally accessed directly by people, except those that tend to their operation, instead their primary function is to operate in a network context.

### GUI Mode

When running a Graphical User Interface (GUI) mode, a range of options are presented to the user through a visual interface consisting of menus, icons and other visual and textual representations.
When a system is used as a general purpose desktop environment, a GUI is normally considered desirable as many feel it provides a more intuitive way to perform many tasks and provides a pleasant, colorful environment enabling rich graphical representations of various documents. Even so, advanced users who operate a GUI enabled system will often spend a significant time entering commands in text console mode, often through a window in their GUI environment known as an xterm in the X Window System.

### Boot Messages

As a system boots it typically displays a series of messages indicating the status (success or failure) of the various attempts to load software, and communicate with the various peripheral devices that may be attached to the machine. These messages can be retrieved at a later time by using the dmesg command at a console prompt.
Once the boot process is complete, most systems will display, in one of various forms, a login prompt and challenge the user to provide the correct password for that user to access the system.
# Linux Guide/PlayStation 3

This guide describes how to get Linux on a PlayStation 3.

## Important Note

The "Other OS" feature, which is required to run Linux on the PS3, is disabled in firmware version 3.21, and later. But still runs on older consoles that have firmware 3.15 or lower. You will not be able to install Linux using this guide unless your PlayStation 3 has firmware 3.15 or lower. There is no official way to downgrade or rollback the firmware.

## Pre-installation Configuration

Currently, Installing an "OtherOS" requires you to re-format the hard drive. On 20Gb models the system allows two 10Gb partitions, while the 60Gb model offers a 10Gb/50Gb configuration for the OtherOS and the PS3 system. You can choose which operating system uses which partition. For this, you will need a USB drive with ~3Mb of free space, a PC with a DVD burner for the Linux Image, and a USB Keyboard and Mouse.

## Installation

Installing Fedora Core 5 PPC will take the system around 2 hours.

## Post-install Configuration

When installation is complete, the startup operating system can be changed. The system can be easily booted back into the cross media bar by holding down the power button while restarting. However, this will reset the system resolution to factory default. From Linux, you can switch to the XMB by typing boot-game-os at a prompt. This will restart the system to the XMB, but will boot back to Linux the next time you restart. Sony has set up a web page which will list compatible operating systems.

## References

* ↑ "Default System". Sony Computer Entertainment. Retrieved 2006-11-10.
* ↑ Chang, Vincent (2006-11-30). "Linux on the PS3: First Encounters". hardware zone. Retrieved 2006-11-30.
* ↑ playstation.com
* PSP Programming/Linux
# Linux Guide/Run an Android emulator

Add 'contrib' to your sources.list:
For example you should have a line like this:
Update and install anbox:
Load two kernel modules needed for anbox:
Download android.img as instructed here. Save it to `/var/lib/anbox/android.img`.
Start the container manager:
Start the session manager:
Launch anbox:

## References

* https://github.com/anbox/anbox/issues/123
* https://askubuntu.com/questions/909629/how-to-launch-anbox
* https://github.com/anbox/anbox/issues/114
# Linux Guide/Network administration

You can have many possible configurations for connecting to the Internet with the Slackware Distro. The most essential part is the computer, but the most basic part is the most current Slackware Distro CDs. You can download these via FTP or HTTP, and rsync is the latest way to acquire the distros, but we won't do it that way seeing that we are just starting out here.
You should have one of two ways available to get into the Internet. It is somewhat foolish to make a guide on how to get online with Slack if we aren't assuming you have another way to connect to the Internet with another (or the same) computer. We will basically copy the way your current PC connects to the Internet with its respective Operating System (OS).
The first way is via Ethernet. This uses the 10/100/1000base-T hardware, and TCP/IP for data packets.
The second way is via Wireless. This uses the 802.11 hardware, and TCP/IP for data packets.
The third and least common today is via analog phone lines using a modem to modulate digital bits to analog datastreams. This uses the modem as the hardware, and TCP/IP for data packets linked with the PPP connection protocol.
The other ways include variations of these protocols and hardware. Such as a Cable/DSL modem connected through 10base-T ethernet to a consumer router/firewall, and translated with NAT to either/both 802.11 and/or ethernet. What this reduces down to is that the direct link from your computer to the closest Internet related device will be, ~98% of the time, an ethernet cable or an 802.11 wireless uplink.
Also included in various hardware connections are IrDA, Bluetooth, Firewire (IEEE 1394/iLINK), and several others. These are not any more "advanced," but are simply not main-stream.
    See also: Linux Guide/Networking
# Linux Guide/Reset a forgotten root password

How to reset forgotten root password in a GNU/Linux distribution with GRUB?
If this is a laptop or a desktop which you have next to you then follow these steps.
1. Shut down the device.
2. Start it again. When you see GRUB menu, press the ‘e’ key on the keyboard before the system starts booting.
3. In the GRUB boot options, scroll down and locate the line that begins with ‘linux’. In this line move the cursor to the end, right after ‘ro quiet’. Delete everything after that. Change 'ro' to 'rw'. Append the parameter init=/bin/bash
4. Press Ctrl+x, or F10, to boot.
5. You will see a root prompt.
Remount the filesystem in read/write mode:
6. Set the password of any user(s).
7. Reboot with the command "reboot -f".
7a. or Reboot with the command "exec /sbin/init"
The new password should work now.
# Linux Guide/Security

Linux, compared to some other popular systems, is very secure, thanks to its UNIX heritage. However, while infecting one's system is difficult, it is not impossible. A mindset of paranoia is usually the most appropriate one with regard to security. In addition, viruses are far from the only part of security. Proper configuration and special care in multi-user systems with many clients are also to be considered.

## Keeping Up-to-Date

No software is perfect. One will almost always find security holes in any sufficiently complicated piece of software. Thus, it is important to stay on top of all security updates provided by your distribution. Many distributions provide update tools to automatically check for updates. Your system may be able to update many packages automatically. Setting up automatic updates is normally a very good idea. Check if your distribution provides a security announcement mailing list, which will inform you of important updates.

## Anti-Virus

Viruses are very uncommon on Linux and in general, you should not have to worry much about your system being compromised by one. However, your Linux system may act as a file server for Windows clients or as an email server that delivers email to Windows clients. In that case, one should ensure that files and emails are clean to prevent infection to your clients.
Samba has ability to plug into the popular free Linux anti-virus system, ClamAV. Your distribution likely has tools to configure this for you. Consult your distribution's documentation for more information.

## Simple Firewall

At minimum you should employ a simple firewall. Below you will find a sample script to provide a simple firewall. I have used this script as a base for more complex firewall schemes on Slackware and Debian systems. It is a very simple script, perhaps others will feel compelled to contribute more advanced and specific use scripts as well.
First we flush the current tables, which basically means that your rule-set is about to change. We then establish 2 rules to drop (not reject) all traffic coming into or being forwarded through our computer. We would like to access the Internet so we create 2 more rules the first which allows traffic into our computer which is distinctly associated with our self initiated outbound requests. The second rule takes care of our localhost... our computer can access our computer and can make use of the network loopback interface. The final 2 rules allow port 80 http and 443 https, they are commented so the ports are not opened by default.
If you decide to utilize this simple script as a base reference please contribute to this page and topic. I have housed this script in several locations each has it's organizational pros and cons. I have placed this file in /root/ and in /root/bin/ and /etc/firewall/ .