Final configuration commands
$ sudo a2ensite site1.com
$ sudo a2ensite site2.com
$ sudo service apache2 reload
Now if you put either site1.com or site2.com in your browser you’ll go to those sites. Now if you own these domain names put you internet IP address with the domain hosting and it will automatically navigate to the specified site location, making accessibility public.
if error: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
$ sudo nano /etc/apache2/httpd.conf
add the line below: ServerName localhost
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message
Today I was trying to install a program using apt-get install however I kept getting this error
Do you want to continue [Y/n]? Y
Selecting previously unselected package libxmlrpc-core-c3.
(Reading database … 60%dpkg: unrecoverable fatal error, aborting:
reading files list for package ‘intltool-debian’: Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)
after hours of research I found out that the reason for this error was the /var/lib/dpkg/status file was corrupted.
I had three options to fix this which were reinstall ubuntu operating system, edit the status files or find a backup status file. I didn’t want to reinstall my operating system so I tried the other two.
(warning: Before trying to edit any file make sure you make a back up of it)
I tried to edit the status file by looking for the package I was trying to install. However I couldn’t find it and I didn’t know what to delete. Luckly there’s dpkg status backupfiles in your system located at /var/backups. I found one that was created a month ago called dpkg.status.3.gz and extracted it and renamed the file status and put into /var/lib/dpkg directory.
Then I tried to install the program using apt-get install and it worked.
from PyQt4 import QtGui, QtCore
# Vertical layout
self.layout = QtGui.QVBoxLayout(self)
# Create widgets
self.label = QtGui.QLabel("What's your name?")
self.name = QtGui.QLineEdit()
self.output = QtGui.QLineEdit()
# Add widgets to the layout
# Connect self.name with self.sayHello(name) when text is changed
self.connect(self.name, QtCore.SIGNAL("textChanged(const QString&)"), self.sayHello)
def sayHello(self, name):
# Set the output text
self.output.setText("Hello " + name + "!")
if __name__ == "__main__":
# Create QApplication
app = QtGui.QApplication(sys.argv)
# Create a HelloQt window and show it
helloqt = HelloQt()
# Run the mainloop
make sure that your python script has the shebang on the first line.
Make pyqt_test.py an executable file by running
$ chmod +x pyqt_test.py
If you want to know how the world works? Know math. -My College history teacher
Rarely do I use math in PHP but when it comes to circuit building, business and statistics. Math is my best friend.
Ask anyone, what is their favorite subject and rarely will you ever hear math. You’ll hear stuff like “I hate math, why do I have to learn this stuff”. Yeah math is a pain to learn. My Algebra teacher Ms. Kline told me that math is different from any other subject, you’ll actually need to practice it in order to be good.
I was trying to find out which distributors offered a better price at what quantity. They had different fixed and variable cost. It’s a 2 simple linear equations. q is the quantity and p is the total price.
When I solved the equation I get that q=5 and p =15. This means that when the quantity is 5 both distributor have the same price but when quantity is less than 5 distributor A has the better price and when quantity is more than 5 distributor B has the better price.