Ubuntu Linux System Administration Basics
Updated Friday, June 25, 2021, by Linode Updated 6/27/21 4:50 PM, by Roy Canseco
This guide presents a collection of common issues and useful tips for Linux system administration. Whether you’re new to system administration or have been maintaining systems for some time, we hope this collection of basic Linux commands will help you manage your system from the command line.
What is Linux Administration?
Linux administration is about setting up disaster recovery, managing new system builds, creating a backup to restore data, Linux hardware management, managing storage, handling file systems, and managing the security of Linux systems. A big part of Linux administration is ensuring that Linux powered systems are stable and secure.
What Should a Linux Administrator Should Know?
Typically Linux system administrators are expected to handle Linux file systems, manage the root user, have a working knowledge of bash commands, and an ability to manage users.
What Are The Duties Of System Administrators In Linux?
Commonly, the Linux administration role typically involves:
- Maintenance of a Linux environment.
- Troubleshooting and providing support when there’s an issue with Linux servers.
- Analysis of log files(mainly error logs).
- Support of LAN and web applications.
- Creation of operational and project-specific solutions for the organization
- Ability to proactively figure out ways to enforce strong security practices, and increase scalability of your Linux environment
Basic Configuration
These tips cover some of the basic steps and issues encountered during the beginning of system configuration. We provide a general Getting Started guide for your convenience if you’re new to Linode and basic Linux system administration. Additionally, you may find our Introduction to Linux Concepts guide useful.
Set the Hostname
Please follow our instructions for setting your hostname. You can use the following commands to make sure it is set properly:
hostname
hostname -f
The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN).
Set the Time Zone
When setting the time zone of your server, it may be best to use the time zone of the majority of your users. If you’re not sure which time zone would be best, consider using Universal Coordinated Time or UTC (i.e., Greenwich Mean Time).
By default, Linodes are set to UTC. Many operating systems provide built-in, interactive methods for changing time zones:
Set the Time Zone in Debian or Ubuntu
Issue the following command and answer the questions as prompted on the screen:
dpkg-reconfigure tzdata
Set the Time Zone Manually on a Linux System
Find the appropriate zone file in /usr/share/zoneinfo/
and link that file to /etc/localtime
. See the examples below for possibilities:
Universal Coordinated Time:
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
Eastern Standard Time:
ln -sf /usr/share/zoneinfo/EST /etc/localtime
American Central Time (including Daylight Savings Time):
ln -sf /usr/share/zoneinfo/US/Central /etc/localtime
American Eastern Time (including Daylight Savings Time):
ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime
Configure the /etc/hosts File
The /etc/hosts
file provides a list of IP addresses with corresponding hostnames. This allows you to specify hostnames for an IP address in one place on the local machine, and then have multiple applications connect to external resources via their hostnames. The system of host files precedes DNS, and hosts files are always checked before DNS is queried. As a result, /etc/hosts
can be useful for maintaining small “internal” networks, for development purposes, and for managing clusters.
Some applications require that the machine properly identify itself in the /etc/hosts
file. As a result, we recommend configuring the /etc/hosts
file shortly after deployment. Here is an example file:
File: /etc/hosts
1
2
<IP_ADDRESS> localhost.localdomain localhost
<IP_ADDRESS> username.example.com username
You can specify a number of hostnames on each line separated by spaces. Every line must begin with one and only one IP address. In the above example, replace <IP_ADDRESS>
with your machine’s IP address. Consider a few additional /etc/hosts
entries:
File: /etc/hosts
1
2
<IP_ADDRESS> example.com
<IP_ADDRESS> stick.example.com
In this example, all requests for the example.com
hostname or domain will resolve to the IP address <IP_ADDRESS>
, which bypasses the DNS records for example.com
and returns an alternate website.
The second entry tells the system to look to <IP_ADDRESS>
for the domain stick.example.com
. These kinds of host entries are useful for using “private” or “back channel” networks to access other servers in a cluster without needing to send traffic on the public network.
Network Diagnostics
In this section, we’ll review some basic Linux commands that will help you assess and diagnose network problems. If you suspect connectivity issues, adding the output from the relevant commands to your support ticket can help our staff diagnose your issue. This is particularly helpful in cases where networking issues are intermittent.
The ping Command
The ping
command tests the connection between the local machine and a remote address or machine. The following commands “ping” google.com
and <IP_ADDRESS>
:
ping google.com
ping <IP_ADDRESS>
These commands send a small amount of data (an ICMP packet) to the remote host and wait for a response. If the system is able to make a connection, it will report on the “round trip time” for every packet. Here is the sample output of four pings to google.com:
PING google.com (<IP_ADDRESS>): 56 data bytes
64 bytes from <IP_ADDRESS>: icmp_seq=0 ttl=54 time=14.852 ms
64 bytes from <IP_ADDRESS>: icmp_seq=1 ttl=54 time=16.574 ms
64 bytes from <IP_ADDRESS>: icmp_seq=2 ttl=54 time=16.558 ms
64 bytes from <IP_ADDRESS>: icmp_seq=3 ttl=54 time=18.695 ms
64 bytes from <IP_ADDRESS>: icmp_seq=4 ttl=54 time=25.885 ms
The time
field specifies in milliseconds the duration of the round trip for an individual packet. When you’ve gathered the amount of information you need, use Control+C to interrupt the process. You’ll be presented with some statistics once the process is stopped. This will resemble:
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3007ms
rtt min/avg/max/mdev = 33.890/40.175/53.280/7.679 ms
There are several important data points to notice:
- Packet Loss, or the discrepancy between the number of packets sent and the number of packets that return successfully. This number shows the percentage of packets that are dropped.
- Round Trip Time (rtt) statistics on the final line report information about all the ping responses. For this ping we see that the fastest packet round trip (min) took 33.89 milliseconds. The average round trip (avg) took 40.175 milliseconds. The longest packet (max) took 53.28 milliseconds. A single standard deviation unit (mdev) for these four packets is 7.67 milliseconds.
The ping command is useful as an informal diagnostic tool to measure point-to-point network latency, and as a tool to simply ensure you are able to make a connection to a remote server.
The traceroute Command
The traceroute
command expands on the functionality of the ping command. It provides a report on the path that the packets take to get from the local machine to the remote machine. Each step (intermediate server) in the path is called a hop. Route information is useful when troubleshooting a networking issue: if there is packet loss in one of the first few hops the problem is often related to the user’s local area network (LAN) or Internet service provider (ISP). By contrast, if there is packet loss near the end of the route, the problem may be caused by an issue with the server’s connection.
Here is an example of output from a traceroute
command:
traceroute to google.com (<IP_ADDRESS>), 30 hops max, 40 byte packets
1 <IP_ADDRESS> (<IP_ADDRESS>) 0.414 ms 0.428 ms 0.509 ms
2 vlan804.tbr2.mmu.nac.net (<IP_ADDRESS>) 0.287 ms 0.324 ms 0.397 ms
3 0.e1-1.tbr2.tl9.nac.net (<IP_ADDRESS>) 1.331 ms 1.402 ms 1.477 ms
4 core1-0-2-0.lga.net.google.com (<IP_ADDRESS>) 1.514 ms 1.497 ms 1.519 ms
5 <IP_ADDRESS> (<IP_ADDRESS>) 1.702 ms <IP_ADDRESS> (<IP_ADDRESS>) 1.731 ms 21.031 ms
6 <IP_ADDRESS> (<IP_ADDRESS>) 26.111 ms <IP_ADDRESS> (<IP_ADDRESS>) 23.582 ms 23.468 ms
7 <IP_ADDRESS> (<IP_ADDRESS>) 123.668 ms <IP_ADDRESS> (<IP_ADDRESS>) 47.228 ms 47.250 ms
8 <IP_ADDRESS> (<IP_ADDRESS>) 76.733 ms <IP_ADDRESS> (<IP_ADDRESS>) 73.582 ms 73.570 ms
9 <IP_ADDRESS> (<IP_ADDRESS>) 86.025 ms 86.151 ms 86.136 ms
10 <IP_ADDRESS> (<IP_ADDRESS>) 80.877 ms <IP_ADDRESS> (<IP_ADDRESS>) 76.212 ms <IP_ADDRESS> (<IP_ADDRESS>) 80.884 ms
11 <IP_ADDRESS> (<IP_ADDRESS>) 81.267 ms 81.198 ms 81.186 ms
12 <IP_ADDRESS> (<IP_ADDRESS>) 77.478 ms pw-in-f100.1e100.net (<IP_ADDRESS>) 79.009 ms <IP_ADDRESS> (<IP_ADDRESS>) 77.437 ms
Often the hostnames and IP addresses on either side of a failed jump are useful in determining who operates the machine where the routing error occurs. Failed jumps are designated by lines with three asterisks (* * *
).
Adding traceroute
output to Linode support tickets is sometimes useful when trying to diagnose network issues. You may also want to forward traceroute
information to your Internet Service Provider (ISP) if you suspect that the connectivity issue is with your ISP’s network. Recording traceroute
information is particularly useful if you are experiencing an intermittent issue.
The mtr Command
The mtr
command, like the traceroute tool, provides information about the route that internet traffic takes between the local system and a remote host. However, mtr
provides additional information about the round trip time for the packet. In a way, you can think of mtr
as a combination of traceroute and ping.
Here is an example of output from an mtr
command:
HOST: username.example.com Loss% Snt Last Avg Best Wrst StDev
1. 2<IP_ADDRESS> 0.0% 10 0.4 0.4 0.3 0.6 0.1
2. vlan804.tbr2.mmu.nac.net 0.0% 10 0.3 0.4 0.3 0.7 0.1
3. 0.e1-1.tbr2.tl9.nac.net 0.0% 10 4.3 4.4 1.3 11.4 4.1
4. core1-0-2-0.lga.net.google.com 0.0% 10 64.9 11.7 1.5 64.9 21.2
5. <IP_ADDRESS> 0.0% 10 1.7 4.5 1.7 29.3 8.7
6. <IP_ADDRESS> 0.0% 10 23.1 35.9 22.6 95.2 27.6
7. <IP_ADDRESS> 0.0% 10 24.2 24.8 23.7 26.1 1.0
8. <IP_ADDRESS> 0.0% 10 27.0 27.3 23.9 37.9 4.2
9. gw-in-f100.1e100.net 0.0% 10 24.1 24.4 24.0 26.5 0.7
Like the ping
command, mtr
tracks the speed of the connection in real time until you exit the program with CONTROL+C. To have mtr
stop automatically and generate a report after ten packets, use the --report
flag:
mtr --report
Be aware that mtr
will pause for a few moments while generating output. For more information regarding mtr
consider our diagnosing network issues with mtr guide.
System Diagnostics
If you’re having an issue with your Linode that is neither related to networking nor another application issue, it may help to rule out “hardware” and operating system level issues. Use the following tools to better diagnose and resolve these.
If you determine that you have a problem with memory usage, refer to our guide on resolving memory usage issues. Use the following tools and approaches to determine the specific cause of your troubles.
Check Current Memory Usage
To see how much memory your system is currently using:
free -m
On a Linode 2GB under moderate use, the output should resemble the following:
total used free shared buffers cached
Mem: 1999 954 1044 105 34 703
-/+ buffers/cache: 216 1782
Swap: 255 0 255
This output takes a bit of careful reading to interpret. Out of a total 1999 megabytes of memory (RAM), the system is using 954 megabytes and has 1044 megabytes free. However, the system also has 703 megabytes of “stale” data buffered and stored in cache. The operating system will “drop” the caches if it needs the space, but retains the cache if there is no other need for the space. It is normal for a Linux system to leave old data in RAM until the space is needed, so don’t be alarmed if only a small amount of memory is “free.”
In the above example, there are 1782 megabytes of memory that are actually free. This means 1782 megabytes are available to your system when you start an additional process or a running application needs more memory.
Monitor I/O Usage with vmstat
The vmstat
tool provides information about memory, swap utilization, I/O wait, and system activity. It is particularly useful for diagnosing I/O-related issues.
If you think you’re having an I/O issue then run the following command:
vmstat 1 20
This runs a vmstat every second, twenty times, giving a sample of the current state of the system. The output generated resembles the following:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 4 32652 47888 110824 0 0 0 2 15 15 0 0 100 0
0 0 4 32644 47888 110896 0 0 0 4 106 123 0 0 100 0
0 0 4 32644 47888 110912 0 0 0 0 70 112 0 0 100 0
0 0 4 32644 47888 110912 0 0 0 0 92 121 0 0 100 0
0 0 4 32644 47888 110912 0 0 0 36 97 136 0 0 100 0
0 0 4 32644 47888 110912 0 0 0 0 96 119 0 0 100 0
0 0 4 32892 47888 110912 0 0 0 4 96 125 0 0 100 0
0 0 4 32892 47888 110912 0 0 0 0 70 105 0 0 100 0
0 0 4 32892 47888 110912 0 0 0 0 97 119 0 0 100 0
0 0 4 32892 47888 110912 0 0 0 32 95 135 0 0 100 0
0 0 4 33016 47888 110912 0 0 0 0 75 107 0 0 100 0
0 0 4 33512 47888 110912 0 0 0 24 113 134 0 0 100 0
0 0 4 33512 47888 110912 0 0 0 0 175 244 0 0 100 0
0 0 4 33512 47888 110912 0 0 0 0 92 148 0 0 100 0
0 0 4 33512 47888 110912 0 0 0 0 114 162 0 0 100 0
0 0 4 33512 47888 110912 0 0 0 36 100 157 0 0 100 0
0 0 4 33388 47888 110912 0 0 0 0 116 166 0 0 100 0
0 0 4 33388 47888 110912 0 0 0 0 97 157 0 0 100 0
0 0 4 33388 47888 110912 0 0 0 0 89 144 0 0 100 0
0 0 4 33380 47888 110912 0 0 0 0 181 185 0 0 99 0
The memory and swap columns provide the same kind of information provided by the “ free -m” command, albeit in a slightly harder to understand format. The most relevant information produced by this command is the wa
column, which is the final column in most implementations. This field displays the amount of time the CPU spends waiting for I/O operations to complete.
If this number is consistently and considerably higher than 0, you might consider taking measures to address your IO usage. However, if the vmstat
output resembles the above, you can be sure in the knowledge that you’re not experiencing an IO-related issues.
If you are experiencing an intermittent issue, you will need to run vmstat
when you experience the issue in order to properly diagnose or rule out an I/O issue. vmstat
output can sometimes help support diagnose problems.
Monitor Processes, Memory, and CPU Usage with htop
If you want a more organized, real-time view of the current state of your system, we recommend a tool called htop
. This is not installed by default on most systems. To install htop
, issue one of the following commands, depending on which distribution you use:
apt-get install htop
To start the program:
htop
You can quit at any time by pressing the F10
or Q
keys. There are a couple of htop
behaviors that may not be initially intuitive. Take note of the following:
- The memory utilization graph displays used memory, buffered memory, and cached memory. The numbers displayed at the end of this graph reflect the total amount of memory available and the total amount memory on the system as reported by the kernel.
- The default configuration of
htop
presents all application threads as independent processes, which may not be clear if you’re not aware of it. You can disable this by selecting the “setup” option withF2
, then “Display Options,” and then toggling the “Hide userland threads” option. - You can toggle a “Tree” view with the
F5
key that displays the processes in a hierarchy and shows which processes were spawned by other processes in an organized format. This is helpful in diagnosing a problem when you’re having trouble distinguishing among processes.
File System Management
Web developers and editors often use the FTP protocol to transfer and manage files on a remote system. FTP, however, is very insecure and inefficient for managing the files on a system when you have SSH access.
If you’re new to Linux systems administration, consider our “ Tools & Reference” section and articles including: installing and using WinSCP, using rsync to synchronize files and using SSH and the terminal.
Caution
If you are giving other users access to upload files to your server, consider the security implications of all additional access that you grant to third parties.
Upload Files to a Remote Server
If you’re used to using an FTP client, OpenSSH (which is included and active with all of the Linode distribution images) allows you to use an FTP-like interface over the SSH protocol. Known as “SFTP,” many clients support this protocol, including WinSCP for Windows, Cyberduck for Mac OS X, and Filezilla for Linux, OS X, and Windows desktops.
If you are accustomed to FTP, SFTP will be very familiar to you. By default, whatever access a user has to a file system at the command line, that user will also have over SFTP. Consider the implications of file permissions when configuring user access.
You can also use Unix utilities including scp
and rsync to securely transfer files to your Linode. On a local machine, a command to copy team-info.tar.gz
would look like:
scp team-info.tar.gz [email protected]:/home/username/backups/
The command, scp
, is followed by the path of the file on the local file system to be transferred. Next, the username and hostname of the remote machine follow, separated by an “at” sign (@
). Follow the hostname with a colon (:
) and the path on the remote server to where the file should be uploaded. Using a more generalized example:
scp [/path/to/local/file] [remote-username]@[remote-hostname]:[/path/to/remote/file]
This command is available by default on OS X and Linux machines. You can use it to copy files to a Linode, as well as between remote servers. If you use SSH keys, you can use the scp
command without entering a password for every transfer.
The syntax of scp
follows the form scp [source] [destination]
. You can copy files from a remote host to the local machine by reversing the order of the paths in the above example.
Protect Files on a Remote Server
Because Linode servers are network accessible and often have a number of distinct users, maintaining the security of files is often an important concern. We recommend you familiarize yourself with our basic security guide. Our guide on access control with user accounts and permissions may provide additional insight.
We suggest the following best practices for maintaining security:
- Only give users the permission to do what they need to. This includes application-specific users.
- Only run services on public interfaces that you are actively using. One common source of security vulnerabilities is in unused daemons that are left running. This includes database servers, HTTP development servers, and FTP servers.
- Use SSH connections whenever possible to secure and encrypt the transfer of sensitive information.
Symbolic Links
Symbolic linking, colloquially “symlinking”, allows you to create an object in your filesystem that points to another object on your filesystem. This is useful when you need to provide users and applications access to specific files and directories without reorganizing your folders. This way you can provide restricted users access to your web-accessible directories without moving your DocumentRoot
into their home directories.
To create a symbolic link, issue a command in the following format:
ln -s /home/username/config-git/etc-hosts /etc/hosts
This creates a link of the file etc-hosts
at the location of the system’s /etc/hosts
file. More generically:
ln -s [/path/to/target/file] [/path/to/location/of/sym/link]
Note the following features of the link command:
- The final term, the location of the link, is optional. If you omit the link destination, a link will be created in the current directory with the same name as the file you’re linking to.
- When specifying the location of the link, ensure that path does not have a final trailing slash. You can create a sym link that targets a directory, but sym links cannot terminate with slashes.
- You may remove a symbolic link without affecting the target file.
- You can use relative or absolute paths when creating a link.
Manage Files on a Linux System
If you’re new to using Linux and manipulating files on the terminal interface we encourage you to consider our guide on using the terminal. This section provides a list of basic commands to manage the contents of your filesystem.
To copy files:
cp /home/username/todo.txt /home/username/archive/todo.01.txt
This copies todo.txt
to an archive folder, and adds a number to the file name. If you want to recursively copy all of the files and subdirectories in a directory to another directory, use the -R
option. This command looks like:
cp -R /home/username/archive/ /srv/backup/username.01/
To move a file or directory:
mv /home/username/archive/ /srv/backup/username.02/
You can also use the mv
command to rename a file.
To delete a file:
rm scratch.txt
This will delete the scratch.txt
file from the current directory.
For more information about file system navigation and manipulation, please consider our documentation of file system navigation.
Package Management
Most Linux systems use package management tools to facilitate the installation and maintenance of all software on your system. For more in-depth coverage of this topic, please reference our package management guide.
While these tools provide a number of powerful features, it is easy to look past the benefits of package management. If you install software manually without package management tools, it becomes difficult to keep your system up to date and to manage dependencies. For these reasons, we recommend installing all software through package management tools unless other means are absolutely necessary. The following tips outline a couple of basic package management tasks.
Find Packages Installed on Your System
Because packages are so easy to install, and often pull in a number of dependencies, it can be easy to lose track of what software is installed on your system. The following commands provide a list of installed packages on your system.
For Debian and Ubuntu systems:
dpkg -l
The following example presents the first few lines of the output of this command on a production Debian Lenny system.
||/ Name Version Description
+++-============================-============================-===============================
ii adduser 3.110 add and remove users and groups
ii apache2-mpm-itk 2.2.6-02-1+lenny2 multiuser MPM for Apache 2.2
ii apache2-utils 2.2.9-10+lenny4 utility programs for webservers
ii apache2.2-common 2.2.9-10+lenny4 Apache HTTP Server common files
ii apt <IP_ADDRESS>+lenny1 Advanced front-end for dpkg
ii apt-utils <IP_ADDRESS>+lenny1 APT utility programs
ii bash 3.2-4 The GNU Bourne Again SHell
Because there are often a large number of packages installed on any given system, the output of these commands can be quite large. As a result, it is often useful to use tools like grep and less
to make these results more useful. For example:
dpkg -l | grep "python"
This will return a list of all packages with the word “python” in their name or description. Similarly, you can use less
:
dpkg -l | less
This will return the same list as the plain “dpkg -l
; however, the results will appear in the less
pager, which allows you to search and scroll more easily.
You can append | grep "[string]"
to these commands to filter package list results, or | less
to display the results in a pager, regardless of distribution.
Find Package Names and Information
Sometimes the name of a package isn’t intuitive, based on the name of the software. As a result, most package management tools make provide an option to search the package database. These search tools may be helpful if you’re looking for a specific piece of software but don’t know what it’s called.
For Debian and Ubuntu systems:
apt-cache search [package-name]
This will search the local package database for a given term and generate a list with descriptions. An excerpt of the output for apt-cache search python
follows:
txt2regex - A Regular Expression "wizard", all written with bash2 builtins
vim-nox - Vi IMproved - enhanced vi editor
vim-python - Vi IMproved - enhanced vi editor (transitional package)
vtk-examples - C++, Tcl and Python example programs/scripts for VTK
zope-plone3 - content management system based on zope and cmf
zorp - An advanced protocol analyzing firewall
groovy - Agile dynamic language for the Java Virtual Machine
python-django - A high-level Python Web framework
python-pygresql-dbg - PostgreSQL module for Python (debug extension)
python-samba - Python bindings that allow access to various aspects of Samba
Note that apt-cache search
queries the full records for all of the packages and not simply the titles and the descriptions displayed here, hence the inclusion of vim-nox
and groovy
which both mention python in their descriptions. To see the full record on a specific package:
apt-cache show [package-name]
This provides information regarding the maintainer, the dependencies, the size, the homepage of the upstream project, and a description of the software.
Since there are often a large number of results for package searches, these commands output a great quantity of text. As a result it is often useful to use tools like grep and less
to make these results easier to scroll through. For example:
apt-cache search python | grep "xml"
This will return the subset of the list of packages which matched for the search term “python” and that mention xml in their name or short description. Similarly:
apt-cache search python | less
This will return the same list as the plain apt-cache search python
but the results will appear in the less
pager. This allows you to search and scroll more conveniently.
You can append | grep "[string]"
to any of these commands to filter package search results, or | less
to display the results in the less
pager, regardless of distribution.
Text Manipulation
Among Linux and UNIX-like systems, nearly all system configuration information is stored and manipulated in plain text form. These following sections show a list of basic Linux commands and tools to manipulate text files.
Search for a String in Files with grep
The grep
tool allows you to search a stream of text, such as a file or the output of a command, for a term or regex pattern.
To use the grep
tool, let’s review an example:
grep "^Subject:.*HELP.*" /home/username/mbox
This will search your mail spool for subject lines (i.e. begins with the word “Subject:"), beginning with any number of characters, containing the word “help” in upper case, and followed by any number of additional characters. It would then print these results in the terminal.
The grep
tool provides additional options that, if specified, force the program to output the context for each match (e.g., with -C 2
for two lines of context). With -n
, grep
outputs the line number of the match. With -H
, grep
prints the file name for each match, which is useful when you “grep” a group of files or “grep” recursively through a file system (using -r
). Use grep --help
for more options.
To grep a group of files, you can specify the file with a wildcard:
grep -i "morris" ~/org/*.txt
This will find and match against every occurrence of the word “morris,” while ignoring case (because of the option for -i
). The grep
tool will search all files in the ~/org/
directory with a .txt extension.
You can use grep
to filter the results of another command that sends output to standard out (stdout
). This is done by “piping” the output of one command into grep
. For instance:
ls /home/username/data | grep "1257"
In this example, we assume that the /home/username/data
directory contains a large number of files that have a UNIX time stamp in their file names. The above command will filter the output to only display those tiles that have the four digits “1257” in their file names. In these cases, grep
only filters the output of ls
and does not look into file contents. For more information regarding grep
, refer to our full documentation of the grep command.
Search and Replace Across a Group of Files
While the grep tool is quite powerful for filtering text on the basis of regular expressions, if you need to edit a file or otherwise manipulate the text, you can use sed
. The sed
tool, or the Stream EDitor, allows you search for a regex pattern and replace it with another string.
sed
is extremely powerful, and we recommend that you back up your files and test your sed
commands thoroughly before running them. Here is a very simple sed
one-liner, intended to illustrate its syntax:
sed -i `s/^good/BAD/` morning-star.txt
This replaces occurrences of the word “good” at the beginning of a line (noted by the ^
) with the string “BAD” in the file morning-star.txt
. The option -i
tells sed
to perform the replacements “in place.” The sed
command can make backups of the files it edits if you specify a suffix after the -i
option, as in -iBAK
. In the above command this option would save the original file as morning-star.txt.BAK
before making changes.
The general format of a sed
statement is:
's/[regex]/[replacement]/'
To match literal slashes (/
), you must escape them with a backslash (\
). As a result, to match a /
character you would use \/
in the sed
expression. If you are searching for a string that has multiple slashes, you can replace the slashes which another character. For instance:
's|r/e/g/e/x|regex|'
This would strip the slashes from the string r/e/g/e/x
so that this string would be regex
after running the sed
command on the file that contains the string.
The following example, from our migrating a server to your Linode document, searches and replaces one IP address with another. In this case <IP_ADDRESS>
is replaced with <IP_ADDRESS>
:
sed -i 's/98\.76\.54\.32/12\.34\.56\.78/'
In the above example, period characters are escaped as \.
. In regular expressions the full-stop (period) character matches to any character if it is not escaped.
For more information about sed
refer to our full documentation of text manipulation with sed.
Edit Text
In many Linode documents, you may be instructed to edit the contents of a file. To do this, you need to use a text editor. Most of the distribution templates that Linode provides come with an implementation of the vi/vim text editor and the nano text editor. These are small, lightweight and powerful text editors that allow you manipulate the text of a file from the terminal environment.
There are other options for text editors, notably Emacs and “zile.” Feel free to install these programs using your operating system’s package manager. Make sure you search your package database so you can install a version compiled without GUI components (i.e. X11).
To open a file, issue a command beginning with the name of the editor you wish to run followed by the name of the file you wish to edit. Here are a number of example commands that open the /etc/hosts
file:
nano /etc/hosts
vi /etc/hosts
emacs /etc/hosts
zile /etc/hosts
When you’ve edited a file, you can save and exit the editor to return to the prompt. This procedure varies between different editors. In Emacs and zile, the key sequence is the same: press control and type x and s to save. This operation is typically notated “C-x C-s” and then “C-x C-c” to close the editor. In nano, press Control-O (notated ^O) and confirm the file name to write the file, and use Control-X to exit from the program.
Since vi and vim are modal editors, their operation is a bit more complex. After opening a file in vi, you can enter “insert” mode by pressing the “i” key; this will let you edit text in the conventional way. To save the file, you must exit into “normal” mode by pressing the escape key (Control-[
also sends escape), and then type :wq
to write the file and quit the program.
This provides only the most basic outline of how to use these text editors, and there are numerous external resources which will provide instructions for more advanced use of this software.
Web Servers and HTTP Issues
Linodes do not come with a web server installed by default. You must install and configure your web server. This allows you to configure your web server in a way that makes sense for your application or website. Linode Guides & Tutorials contains a number of documents regarding the installation and maintenance of various web servers.
This section covers a number of basic web serving tasks and functions, as well as some guidance for users new to the world of web servers.
Serve Websites
Web servers work by listening on a TCP port, typically port 80 for HTTP and port 443 for HTTPS. When a visitor makes a request for content, the servers respond by delivering the resource requested. Typically, resources are specified with a URL that contains the protocol, http
or https
; a colon and two slashes, ://
; hostname or domain, www.example.com
or username.example.com
; and the path to a file, /images/avatar.jpg,
or index.html
. A full URL would resemble http://www.example.com/images/avatar.jpg
.
In order to provide these resources to users, your Linode needs to be running a web server. There are many different HTTP servers and countless configurations to provide support for various web development frameworks. The three most popular general use web servers are the Apache HTTP server, Lighttpd (“Lighty”), and nginx (“Engine X”). Each server has its strengths and weaknesses, and your choice depends largely on your experience and your needs.
Once you’ve chosen a web server, you need to decide what (if any) scripting support you need to install. Scripting support allows you to run dynamic content with your web server and program server side scripts in languages such as Python, PHP, Ruby, and Perl.
If you need a full web application stack, we encourage you to consider one of our more full-featured LAMP stack guides. If you need support for a specific web development framework, consult our tutorials for installing and using specific web application frameworks.
How to Choose a Web Server
In most situations, end users are unaware of which web server you use. As a result, choosing a web server is often a personal decision based on the comfort of the administrator and the requirements of the deployment in question. This can be a challenge for the new systems administrator. This section offers some guidance by providing some background and information on the most popular web servers.
The Apache HTTP Server is considered by some to be the de facto standard web server. It is the most widely deployed open-source web server, its configuration interface has been stable for many years, and its modular architecture allows it to function in many different types of deployments. Apache forms the foundation of the LAMP stack, and supports the integration of dynamic server-side applications into the web server.
By contrast, web servers like Lighttpd and nginx are optimized for efficiently serving static content. If you have a deployment where server resources are limited and are facing a great deal of demand, consider one of these servers. They are functional and stable with minimal system resources. Lighttpd and nginx can be more difficult to configure when integrating dynamic content interpreters.
Your choice of web servers is based on your needs. Specific choices depend on factors like the type of content you want to serve, the demand for that content, and your comfort with that software as an administrator.
Apache Logs
When there is something wrong with Apache, it can be difficult to determine what the cause of the error is from the behavior of the web server. There are a number of common issues with which you might begin your troubleshooting efforts. When more complex issues arise, you may need to review the Apache error logs.
By default, error logs are located in the /var/log/apache2/error.log
file (on Debian-based distributions). You can track or “tail” this log with the following command:
tail -F /var/log/apache2/error.log
In the default virtual host configurations suggested in our Apache installation and LAMP guides, we suggest adding a custom log setting:
File: Apache Virtual Host Configuration
1
ErrorLog /var/www//html/example.com/logs/error.log CustomLog /var/www/html/example.com/logs/access.log combined
Where example.com
represents the name of your virtual host and the location of its resources. These directives make Apache create two log files that contain logging information specific to that virtual host. This allows you to easily troubleshoot errors on specific virtual hosts. To track or tail the error log:
tail -F /var/www/html/example.com/logs/error.log
This will allow you to see new error messages as they appear. Problems can be diagnosed by using specific parts of an error message from an Apache log as a term in web search. Common errors to look for include:
- Missing files, or errors in file names
- Permissions errors
- Configuration errors
- Dynamic code execution or interpretation errors
DNS Servers and Domain Names
The Domain Name System, or DNS, is the service that the internet uses to associate the hard to remember and manage IP addresses with more human-usable domain names. This section will address several specific DNS-related tasks. To learn more about DNS, check out our overview of the domain name system. If you are familiar with DNS and just need to figure out how to configure your DNS server, see our guide for the Linode DNS manager.
Redirect DNS Queries with CNAMEs
CNAME DNS records make it possible to redirect requests for one hostname or domain to another hostname or domain. This is useful in situations where you want to direct requests for one domain to another, but don’t want to set up the web server to handle requests.
CNAMEs are only valid when pointing from one domain to another. If you need to redirect a full URL, you will need to set up a web server and configure redirection and/or virtual hosting on the server level. CNAMEs will allow you to redirect subdomains, such as team.example.com
, to other subdomains or domains, such as jack.example.org
. CNAMEs must point to a valid domain that has a valid A Record, or to another CNAME.
Although limited in their capabilities, CNAMEs can be quite useful in some situations. In particular, if you need to change the hostname of a machine, CNAMEs are quite useful. To learn how to set up CNAME records with the Linode Manager, refer to our DNS Manager Guide.
Set Up Subdomains
When reading domain names, we refer to parts before the main or first-level domain as “subdomains.” For example, in the domain team.example.com
, team
is a subdomain for the root domain example.com
.
Follow these steps to create and host a sub-domain:
-
First, create an A Record in the DNS zone for the domain. You can do this using the Linode DNS Manager. You may host the DNS for your domain with any provider you choose.
-
Set up a server to respond to requests sent to this domain. For web servers like Apache, this requires configuring a new virtual host. For XMPP servers you must configure an additional host to receive the requests for this host. For more information, consult the documentation for the specific server you wish to deploy.
-
Once configured, subdomains function almost identically to root domains on your server. If you need to, you can set up HTTP redirection for the new subdomain.
SMTP Servers and Email Issues
We provide a number of guides that cover email-related topics. In this section, we’ll explain how to choose an email setup that fits your needs and how to configure your Linode to send email.
Note About Email at Linode
This guide may involve or result in sending email. In an effort to fight spam, Linode restricts outbound connections on ports 25, 465, and 587 on all Linodes for new accounts created after November 5th, 2019. For more information, please see Sending Email on Linode.
This guide may involve or result in sending email. In an effort to fight spam, Linode restricts …
Choose an Email Solution
There are two major components that are required for email functionality. The most important part is the SMTP server or “Mail Transfer Agent.” The MTA, as it is often called, sends mail from one server to another. The second part of an email system is a server that permits users to access and download that mail from the server to their own machine. Typically these servers use a protocol such as POP3 or IMAP to provide remote access to the mailbox.
There may also be other components in the email server tool chain. These components may be optional depending on the requirements of your deployment. They include filtering and delivery tools like procmail, anti-virus filters like ClamAV, mailing list managers like MailMan, and spam filters like SpamAssassin. These components function independently of the MTA and remote mailbox server.
The most prevalent SMTP servers or MTAs in the UNIX-like world are Postfix, Exim, and Sendmail. Sendmail has the longest history and many system administrators have extensive experience with it. Postfix is robust and modern, and is compatible with many different configurations. Exim is the default MTA in Debian systems, and many consider it to be easier to use for basic tasks. For remote mailbox access, servers like Courier and Dovecot are popular options.
If you need an easy-to-install email solution, consider the Citadel groupware server. Citadel provides an integrated “turnkey” solution that includes an SMTP server, remote mailbox access, real time collaboration tools including XMPP, and a shared calendar interface. Along similar lines, we also provide documentation for the installation of the Zimbra groupware server.
If, by contrast, you want a more simple and modular email stack, we urge you to consider one of our guides built around the Postfix SMTP server.
Finally, it’s possible to outsource email service to a third-party provider, such as Google Workspace or FastMail.fm. These services allows you to send and receive mail from your domain, without hosting email services on your Linode.
Send Email From Your Server
For simple configurations, you may have no need for a complete email stack like some of those documented in our email guides. However, applications running on that server still need to be able to send mail for notifications and other routine purposes.
How Do I Manage Files in Linux?
To manage files and directories in Linux you can use wildcard patterns for file manipulation, use commands like gzip
, xz
, and bzip2
to compress or decompress a file. Commands like copy
move
and remove
can be used to remove files. There are many more commands that can be used, however these are the most common.
You can view your current directory by running echo $PWD
. To view all items within your current working directory, type ls
and press enter.
Typing ls will simply output all file names, but if you wish to see more details run the following command:
ls -al
Output:
total 6
drwxr-xr-x 6 linode linode 4096 Nov 30 00:35 .
drwxr-xr-x 45 linode linode 4096 Dec 30 00:35 ..
drwxr-xr-x 5 linode linode 4096 Nov 30 00:35 20122
drwxr-xr-x 7 linode linode 4096 Nov 30 00:35 20122_db
drwxr-xr-x 3 linode linode 4096 Nov 30 00:35 linode_1
-rw-rw-r-- 1 linode linode 93810 Nov 30 00:35 linode.png
In the output, the d
in drwxr-xr
represents a directory and -rw-rw-r--
represents a file since it is not prefaced with d
.
You can use cp
to copy files, mv
to move them and rm
to delete files. Similarly, you can use mkdir
to create directories, and rmdir
to remove directories.
For efficient Linux administration, you have to be able to handle multiple files recursively. You can use -R
option for recursive listing, copying or even deletion.
Using Wildcards And Globbing For Better Linux Administration
Most other operations we saw in the section above were on a single filesystem, on the entire tree. As complexities in administration grow with your file system, it becomes difficult to use these options. This is where Wildcards and Globbing are extremely helpful.
Globbing helps us point to target files using wildcard patterns. Here is how the matching works:
*
matches any string pattern?
matches any single character[
matches any single character within[
brackets
The following example will test a Wildcard to see how you can only filter files that have 3, 5, or between 3-5 characters. In the current directory, we have the following files:
ls
linode_1 linode_2 linode_3 linode_4 linode_5
Now, if we run the following command:
ls linode[3-5]
We will get the following output:
linode_3 linode_4 linode_5
This page was originally published on Sunday, December 13, 2009.


My name is Tanzil Ahmed,I am a creative designer . I like to create design .I love my work its y passion .I maintain quality. I like to design in high quality so that it can take other attention. I work so hard until I satisfied with it. When I do other jobs I don't think I is not mine I think it also my work I try my best for make it batter. I design App UI/UX , Web design, logo design, motion graphich,banner design, business card design, poster design.


ISP’s are updating your site without your permission
ISP’s and proxies can sometimes update your site HTML without your permission. See how they do it, why, and how you can put a stop to it.
I’m in the fortunate position where I have to commute an hour and fifteen minutes in to and back from work each day. Some people might see that as a curse but I really enjoy the opportunity for some quiet time, my laptop, and a table. It also allows me to write articles like this.
One of the issues that I do face is the intermittent access to the internet over the course of the journey.
Travelling Wi(fi)lburies
The train comes packed with Wifi however they only provide 20Mb for the entire day which gives me access to around 10 web pages (if I’m lucky, don’t get me started on the size of web pages these days).
Instead I opt for the use of my mobile phones wifi hotspot and the 4G/3G connection I can pick up for most of the journey. I use this quite a bit when I’m out and about and as a result I now sit it on 4gig a month (which is only £15… not too bad really).
So with my tethered connection to the internet and my laptop and the go all that is left is to start writing…. right?
Well writing yes, but I’m hamstrung when it comes to doing some other work.
Hey ISP’s, leave websites alone
…all in all you’re just a-nother brick in the wall… a really annoying wall that shouldn’t be there. Let me tell you what I mean.
One of the things that I work on in the mornings is reviews of existing responsive design sites for the RWD example section of the site. I take a screen shot of the site using Am I Responsive and then I delve into the HTML/CSS/JS to find out how they put the site together, did they employ progressive enhancement, did they use plugins, how were they configured, is the site using RWD images and which parts of the spec, is there compression on the files, do the concatenate files, does the site use critical CSS etc etc.
The issue that I’ve found recently is that when I ‘view-source’ on a site that I’m reviewing I do not get the version that someone worked very hard to publish… instead I get a version that the ISP decides is best for me.
ISP Ch-ch-ch-changes
Recently Jeffrey Zeldman released a new site about the new studio he has founded aptly named Studio.Zeldman. As the grandfather of designing with web standards any new site from Jeffrey was something that I really wanted to take a look into and see how he went about building something in todays age of the web.
Images
The first thing I looked at was how the images were being included.
<img src=“http://<IP_ADDRESS>/bmi/studio.zeldman.com/img/keynotespeaker.jpg” srcset=“img/keynotespeaker-md.jpg 1000w, img/keynotespeaker-lg.jpg 2000w” alt=“Photo of Jeffrey Zeldman onstage.”>
Looks like he’s using srcset
and leaving off the sizes
attribute, but hold the phone he’s also using some kind of different CDN for the main image source and his own server for the other srcset versions?
No he’s actually not. The ISP is looking at the SRC files and updating the URL to go through http://<IP_ADDRESS>/bmi/
I saved both of the files and they are exactly the same. Both weigh in at 3,922 bytes (Kudos to Jeffrey for adding the smallest version as the default src).
CSS
The next thing I looked at was the CSS and I noticed that Jeffrey had not included a CSS file at all, and instead he had inlined everything with a strange implementation method.
<style style=“display:none”>/*!
* All Styles here*/
</style>
That seemed a little strange to include all of the styles on the page instead of just the “above the fold” styles. I concluded that because it was only a single page site at the moment I could see there could be a benefit in removing the HTTP request and going all inline with the expense of having a slightly bigger HTML request each time.
Also the whole style="display:none;"
seemed super weird… those elements are hidden by default and I’m not actually sure you could see them if you wanted to… was this a new method that reaped huge benefits that Jeffrey was sharing with us?
No, it wasn’t.
The ISP was taking the actual reference to the CSS
<link rel="stylesheet" href="/css/main.css?version=1.7" />
pulling out the the CSS and inlining it into the page. There was no difference in the CSS itself, just in the way it was being delivered. This means that the ISP is disallowing the intention of the web developer for me to cache the CSS file and never have to re-request it (depending on the Cache expiry) and instead adding it to the document
Javascript
The javascript files are a little bit different to the CSS files.
In Jeffrey’s site he has 3 script tags in the footer for scripts
, plugins
and form
. In this case these should be concatenated into a single file.
The ISP in this case doesn’t something a little strange. It keeps the first <script>
tag as it was and then inlines the next 2 scripts again using the strange <script style="display:none">
method.
My only guess here is that the scripts file was deemed to be too large to inline and stayed as a standard file, but I’m grasping at straws to properly explain it.
The weigh in
Lets just assume the ISP was trying to be nice to me by reducing my bandwidth… except that the original HTML file is 30kb and their ‘enhanced’ version is 143kb.
Downloading the whole web page we see a similar result
- Original: 615,648 bytes (647 KB on disk) for 17 items
- ISP version: 616,132 bytes (639 KB on disk) for 14 items
The ISP was able to save me a 3 HTTP requests by combining 3 JS files into a 1 file (2 requests saved) and inlining all of the CSS (1 request saved). This is at the expense of a larger page for every additional visit to the site.
These figures aren’t great in my opinion, but I’m sure they would be a bit better on a site that isn’t carefully developed with care taken to be as performant as possible.
My point
Yes, I do have a point.
I can see why this can be a good idea and it links back to my issue with the 20MB on offer with the trains default wifi.
Our web pages have become so bloated these days that companies like Google (AMP), Facebook (Instant Pages), and ISP’s are taking matters into their own hands. They are providing services to allow webpages to be crunched down and delivered much faster because the majority of the sites out there are too bloated and too slow.
The knock on affect is that when people who are web standards and web performance minded build their sites they do so in a way that is best for the users. These sites do not need any configuring or hacking after the fact, they just need to be served as they should be.
You can force the ISP’s and other proxies to leave your stuff alone but it requires making a few server level changes.
A Simpler fix — be secure
HTTPS is quickly becoming a default approach to every website build, or at least it should be.
With the prices of SSL Certificates dropping, places like LetsEncrypt providing free SSL certificates, and CDN’s like Cloudflare offering free SSL there’s little reason not to do it.
The added benefit is the case of this article is that ISP’s are not able to fiddle with the documents and files being transferred across the world, so no updating image sources or inlining all of you CSS.
Another benefit with https means that you can switch across to http2 as well. While HTTPS isn’t a specific requirement in the specification so far none of the browsers are looking to do any implementations to support http2 on an un-encrypted, something for which I whole heartedly agree.


Check out what we have for you!
Choose from any of our 4 available languages(English, Hindi, Kannada, Telugu) and play multiple levels!
You can use either help or skip level option if you are stuck!
It's absolutely free to play, you can also purchase the ad free version!


Prevention
Keeping your teeth and gums healthy is a team effort between you and your dentist and hygienist. Comprehensive preventative care includes far more than cleaning, hygiene instructions and check-ups. Healthy habits are foundational to keeping your teeth for a lifetime and healthy teeth and surrounding tissues are foundational to overall health. We suggest that you visit us every six months if you have healthy gums.
Hygiene services include:
1- Assessment of your oral health — the mouth is a window into the health of the body. Diseases that affect the entire body (such as diabetes) may first be noticed in the mouth.
2- Ultrasonic stain removal—daily brushing and flossing will help keep calculus formation to a minimum, but it won’t completely prevent it. Professional dental cleaning at least twice a year is necessary to remove calculus from places your toothbrush and floss may have missed.
3- Digital low radiation x-rays—dental xrays can provide help to the dentist to examine the underlying bone, the roots of the teeth or erupted teeth as well as the contact areas where teeth touch one another and cannot be seen any other way.
4- Oral cancer screening — early detection of oral cancer saves lives.
5- Periodontal charting — measurements of supporting bone and gums around the teeth it is the best way to differentiate between periodontal health or disease.
6- Oral hygiene instructions — part of our job is to make sure you are doing your job to maintain a health mouth. If we see anything that we can help with we will give instruction on how stay cavity free.
7- Sealants — one of the most common places for tooth decay is on the chewing surfaces of the back teeth. A sealant is a plastic material that is applied to that chewing surface and acts as a barrier, protecting enamel by sealing out plaque and food.
8- Thorough exam — using xray and visual the dentist will exam the mouth and teeth and give recommendations for any condition that he may find.
9- Fluoride — is a mineral that naturally occurs in all water sources. During childhood, when teeth still are forming, fluoride works by making tooth enamel more resistant to the acid that causes tooth decay. At the end of your cleaning appointment fluoride will be offered to the patient, we call fluoride, "vitamins for the teeth".
10- Referrals – from time to time a patient will need to see a specialist for their circumstance. We will provide you with the name of those we would trust the care that you need.


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 2-3
Heat the butter in a pan over a low to medium heat. When the butter is foaming, add the chopped shallot and garlic and fry for 8-10 minutes, stirring regularly, or until softened but not coloured.
Add the sliced cucumber and nutmeg and season, to taste, with salt and freshly ground white pepper. Stir well and continue to fry the mixture for 3-4 minutes, stirring occasionally, until soft and translucent.
Add the peas and stock to the pan and bring the mixture to a simmer. Cover the pan with a lid and cook gently for 6-8 minutes, adding a little more stock as necessary to prevent the mixture from drying out, until the peas are tender. Remove the pan from the heat and set aside to cool slightly.
When the mixture has cooled, transfer it to a food processor and blend to a smooth purée. Set aside to cool further.
When the mixture has cooled, add the chopped lettuce leaves and stalk and the chopped sorrel and blend again until smooth.
Pass the mixture through a fine sieve into a large bowl. Whisk in the crème fraîche until well combined, then chill in the fridge until cold.
To serve, ladle the English garden soup into shallow serving bowls. Garnish with the cooked prawns, if using.


Thousands protest in Georgia demanding snap polls
Protesters gathered outside the parliament building in one of the biggest anti-government rallies in years amid mounting pressure on the ruling Georgian Dream party led by powerful oligarch Bidzina Ivanishvili.
Thousands of opposition supporters rallied in Georgia on Sunday, demanding the government's resignation and early parliamentary polls after the increasingly unpopular ruling party backtracked on promised electoral reforms.
Protesters gathered outside the parliament building on the capital Tbilisi's main thoroughfare in one of the biggest anti-government rallies in years amid mounting pressure on the ruling Georgian Dream party led by powerful oligarch Bidzina Ivanishvili.
Demanding the government's resignation and snap parliamentary polls, the crowd waved Georgian and European Union flags, lit coloured flares and held up a giant banner with the anti-Ivanishvili slogan "All against One".
Opposition parties had called for the protest after forming an unprecedented united front against Georgian Dream, whose MPs last week voted down legislation to hold parliamentary elections next year under a new proportional voting system.
The opposition accused Ivanishvili of orchestrating the bill's failure, saying the ruling party unfairly benefits from the current voting system.
At an earlier protest on Thursday, some 10,000 people rallied in Tbilisi, vowing to hold "permanent mass protests" until their demands for snap polls are met.
Ivanishvili, Georgia's richest man, had announced "large-scale political reform" under pressure following mass street protests in June and July.
The summer protests saw a violent police crackdown in which 240 people were injured and two peaceful protesters lost an eye, including a teenage girl.
Georgian Dream, in power since 2012, has seen its popularity plummet amid widespread discontent over its failure to address economic stagnation and perceived backsliding on its commitment to democracy.
Critics have accused Ivanishvili, who is widely believed to be calling the shots in Georgia, of persecuting political opponents, suffocating critical media, and creating a corrupt political system where his private interests dominate government's decision-making.


Select a template below, then upload all the form images you want to process. You can drag & drop files and folders from your desktop onto this webpage to upload them.
Select a template below, then upload all the form images you want to process.
You can drag & drop files and folders from your desktop onto this webpage to upload them.
Create a template Upload a template


What is Idiomatic syntax?
val immutable = "i'm invulnerable"
immutable = "you can't change me" // val re-assign compiler error
var mutable = "i can be compromised"
mutable = "and there's nothing you can do about it"
Because..
Except when...
At the end of the task it should compile and there should be N less failed test, where N will be mentioned as part of each exercise
The project code expects an immutable variable named iAmAlwaysFalse
and mutable variable named iCanBeFalseOrTrue
in existing object named tsns.scalafundamentals
val stringly = "i'm a string"
val verbose: String = "i'm a verbose string assignment": String
def stringCaller = "my return type is inferred"
Polymorphic type inference
val sequenceOfString = Seq("this sequence type", "is", "inferred")
val mixedBag = Seq(1, 2, "three", "banana", Math.PI)
Inferring a common ancestor
class Animal
class Dog extends Animal
class Cat extends Animal
// evaluates to a Seq[Animal]
val animals = Seq(new Dog, new Cat)
Sidenote: Any vs Nothing, top vs bottom types.. next slide/aside.
As we saw earlier, Any is the supertype of all types
`Nothing` or `Null` are bottom types, descendants of all types
I wanted myList
to contain integers. How can I make sure it in the code?
Fix the test related to myList
.
What was the problem? What would be a solution? What would be the typesafest solution?
Are you still with me?
def mean(nums: Seq[Int]) = nums.sum / nums.size
def mean(nums: Seq[Int]) = nums.sum / nums.size
def mean(nums: Seq[Int]) = nums.sum / nums.size
Fix the failed 'Functions'. What was the problem?
val mean = (nums: Seq[Int]) => nums.sum / nums.size
You can build very expressive Domain Specific Languages (DSL) in Scala because of the flexibility of its calling semantics
For the most part you sould continue to use the same semantics as in Java
foo(42, bar)
target.foo(42, bar)
target.foo()
but there are other cases we can consider..
val bigList = 1 to 10e6.toInt
bigList.size
val piSeq = Seq("the", "value", "of", "pi", "is", Math.PI)
piSeq mkString " "
val square = (x: Int) => Math.pow(x, 2)
Seq(1,2,3) map square
Nearly every line of Scala is an expression. Where expressions always return a value, statements do not.
Some examples of statements:
Some constructs that are traditionally statements in other languages are expressions in Scala: if/else, for/while (type Unit), throw (type Nothing)
When passing a function as the last parameter it's appropriate to use infix notation with an expression.
Seq(1,2,3,2,1).foldLeft(0) { (last: Int, num:Int) =>
if (last >= num) last
else num
}
Fix the failed 'Expressions'. What was the problem? How it can be solved in Scala?
class Batman(alterEgo: String) {
def themeSong() = "DA NA NA NA NA NA, BATMAN!"
override def toString =
s"the batman is aka as $alterEgo"
}
'Classes' section expect a variable batman
that has accessible alterego
and unaccesible name
properties. Add your code (hint: Class) to tsns.scalafundamentals
to support it. Quiz: in how many different ways could it be implemented?
case class Superhero(name: String, sidekick: String)
object Scalator {
def apply(events: Seq[String]) = new Scalator(events)
}
class Scalator(events: Seq[String]) {
override def toString =
s"Scalator events: ${events.mkString(", ")}"
}
Scalator(Seq("Why scala?", "Scala Fundamentals", "Collections"))
'Case Classes' section expect a variable superman
that has accessible sequel
property. Add your code (hint: case class) to tsns.scalafundamentals
to support it.
One more test in this section expects to be able to create a superman with actorName
parameter. Quiz: in how many different instances of the class could be out there?


- s12 - Variable in class org.magiclen.geographiclib.GeodesicData
-
distance between point 1 and point 2 (meters).
- S12 - Variable in class org.magiclen.geographiclib.GeodesicData
-
area under the geodesic (meters2).
- second - Variable in class org.magiclen.geographiclib.Pair
-
The second member of the pair.
- Set(double) - Method in class org.magiclen.geographiclib.Accumulator
-
Set the value to a double.
- sincosd(double) - Static method in class org.magiclen.geographiclib.GeoMath
-
Evaluate the sine and cosine function with the argument in degrees
- SinCosSeries(boolean, double, double, double[]) - Static method in class org.magiclen.geographiclib.Geodesic
-
- sq(double) - Static method in class org.magiclen.geographiclib.GeoMath
-
Square a number.
- STANDARD - Static variable in class org.magiclen.geographiclib.GeodesicMask
-
All of the above, the "standard" output and capabilities.
- Sum() - Method in class org.magiclen.geographiclib.Accumulator
-
Return the value held in the accumulator.
- Sum(double) - Method in class org.magiclen.geographiclib.Accumulator
-
Return the result of adding a number to sum (but don't change
sum).
- sum(double, double) - Static method in class org.magiclen.geographiclib.GeoMath
-
The error-free sum of two numbers.


We have tables!
- scale enterprise partnerships
- benchmark intuitive paradigms
- strategize B2C web services
- leverage impactful content
- reinvent customized technologies
- redefine proactive supply-chains
- cultivate 24/365 communities
- integrate transparent methodologies
- matrix web-enabled systems
- revolutionize granular portals


J1939 Clear DTCs contains the channels specific to the Clear DTCs command.
This channel sets the type of DTCs to clear for the device addressed through the Address to Query channel. Set this channel to the desired value before setting the Verify DTC command. The values are as follows:
0 - Clear Active and Previously Active DTCs
1 - Clear Active DTCs
2 - Clear Previously Active DTCs


We exchange mices!
- optimize sticky methodologies
- enable strategic action-items
- orchestrate seamless interfaces
- utilize web-enabled deliverables
- integrate global infrastructures
- mesh scalable eyeballs
- enhance distributed deliverables
- synthesize dynamic methodologies
- visualize bricks-and-clicks eyeballs


|
areaDetector
3-5-0
EPICS areaDetector framework
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <set>
#include <epicsEvent.h>
#include <epicsTime.h>
#include <epicsThread.h>
#include <epicsMessageQueue.h>
#include <iocsh.h>
#include <cantProceed.h>
#include <epicsString.h>
#include <epicsExit.h>
#include "Spinnaker.h"
#include "SpinGenApi/SpinnakerGenApi.h"
#include "ADDriver.h"
#include <epicsExport.h>
Classes | |
| class | ImageEventHandler |
| class | ADSpinnaker |
| Main driver class inherited from areaDetectors ADDriver class. More... | |
Macros | |
| #define | DRIVER_VERSION 1 |
| #define | DRIVER_REVISION 0 |
| #define | DRIVER_MODIFICATION 0 |
| #define | DEFAULT_PACKET_DELAY 400 |
| #define | CALLBACK_MESSAGE_QUEUE_SIZE 10 |
| #define | FIRST_SP_PARAM SPVideoMode |
Functions | |
| int | ADSpinnakerConfig (const char *portName, int cameraId, int traceMask, int memoryChannel, int maxBuffers, size_t maxMemory, int priority, int stackSize) |
| Configuration function to configure one camera. More... | |
| void | indent (FILE *fp, unsigned int level) |
| epicsExportRegistrar (ADSpinnakerRegister) | |
| #define CALLBACK_MESSAGE_QUEUE_SIZE 10 |
| #define DEFAULT_PACKET_DELAY 400 |
| #define DRIVER_MODIFICATION 0 |
| #define DRIVER_REVISION 0 |
| #define DRIVER_VERSION 1 |
| #define FIRST_SP_PARAM SPVideoMode |
| enum SPConvertDirection_t |
| enum SPPixelConvert_t |
| enum SPPropertyType_t |
| enum SPTimeStamp_t |
| enum SPUniqueId_t |
| int ADSpinnakerConfig | ( | const char * | portName, |
| int | cameraId, | ||
| int | traceMask, | ||
| int | memoryChannel, | ||
| int | maxBuffers, | ||
| size_t | maxMemory, | ||
| int | priority, | ||
| int | stackSize | ||
| ) |
Configuration function to configure one camera.
This function need to be called once for each camera to be used by the IOC. A call to this function instanciates one object from the ADSpinnaker class.
| [in] | portName | asyn port name to assign to the camera. |
| [in] | cameraId | The camera index or serial number; <1000 is assumed to be index, >=1000 is assumed to be serial number. |
| [in] | traceMask | The initial value of the asynTraceMask. |
If set to 0 or 1 then asynTraceMask will be set to ASYN_TRACE_ERROR. If set to 0x21 (ASYN_TRACE_WARNING | ASYN_TRACE_ERROR) then each call to the FlyCap2 library will be traced including during initialization.
| [in] | memoryChannel | The camera memory channel (non-volatile memory containing camera parameters) to load during initialization. If 0 no memory channel is loaded. If >=1 thenRestoreFromMemoryChannel(memoryChannel-1) is called. |
Set memoryChannel to 1 to work around a bug in the Linux GigE driver in R2.0.
| [in] | maxBuffers | Maxiumum number of NDArray objects (image buffers) this driver is allowed to allocate. This driver requires 2 buffers, and each queue element in a plugin can require one buffer which will all need to be added up in this parameter. 0=unlimited. |
| [in] | maxMemory | Maximum memory (in bytes) that this driver is allowed to allocate. So if max. size = 1024x768 (8bpp) and maxBuffers is, say 14. maxMemory = 1024x768x14 = 11010048 bytes (~11MB). 0=unlimited. |
| [in] | priority | The EPICS thread priority for this driver. 0=use asyn default. |
| [in] | stackSize | The size of the stack for the EPICS port thread. 0=use asyn default. |
| epicsExportRegistrar | ( | ADSpinnakerRegister | ) |
| void indent | ( | FILE * | fp, |
| unsigned int | level | ||
| ) |


The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.) that doesn't distract from the layout.
Is simply dummy text of the pricing?
The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.)
The purpose of lorem ipsum is to create a natural looking block of text (sentence, paragraph, page, etc.)We're Here To Help And Answer Any Questions You Might Have. We Look Forward To Hearing From You


Design philosophy¶
Easy to use
Easy to install
Easy to get started
Open Source
Easy to collaborate
Reproducible
Easy access to new features
Easy to use¶
Common operations such as reading a file should only need a few lines of code.
Make extensive use of existing standard libraries for scientific computing such as numpy, matplotlib and pandas.
Easy to get started¶
By providing many examples to cut/paste from.
Examples are available in two forms:
Open Source¶
MIKE IO is an open source project licensed under the BSD-3 license. The software is provided free of charge with the source code available for inspection and modification.
Contributions are welcome, more details can be found in our contribution guidelines.
Easy to collaborate¶
By developing MIKE IO on GitHub along with a completely open discussion, we believe that the collaboration between developers and end-users results in a useful library.
Reproducible¶
By providing the historical versions of MIKE IO on PyPI it is possible to reproduce the behaviour of an older existing system, based on an older version.
Install specific version:
pip install mikeio==0.4.3
Easy access to new features¶
Features are being added all the time, by developers at DHI in offices all around the globe as well as external contributors using MIKE IO in their work. These new features are always available from the master branch on GitHub and thanks to automated testing, it is always possible to verify that the tests passes before downloading a new development version.
Install development version:
pip install https://github.com/DHI/mikeio/archive/master.zip


SILENT FALL A film review by Scott Renshaw Copyright 1994 Scott Renshaw
Starring: Richard Dreyfuss, Liv Tyler, J. T. Walsh, Ben Faulkner, Linda Hamilton, John Lithgow. Screenplay: Akiva Goldsman. Director: Bruce Beresford.
If you have not already done so, please add to your list of movie cliches the "psychiatrist/psychologist who is as screwed up as anyone he/she is treating." While some might argue (and suicide statistics might support) that this is a case of art imitating life, it is becoming far too predictable to toss a psychiatrist with personal demons into a suspense plot as flavoring; they are the MSG of the psychological thriller. Surely there's a happy, well- adjusted shrink out there somewhere. Well, not in SILENT FALL, and the inclusion of that tired standby is just one of the many, many things wrong with this good-looking but gimmicky thriller.
The psychiatrist is Dr. Jake Rainer (Richard Dreyfuss), an expert in autism who has given up his treatment of children in the wake of a patient's death. He is called in by the local sheriff (J. T. Walsh) when the only witness to the murder of a prominent couple appears to be their autistic son Tim (Ben Faulkner). With the assistance of Tim's sister Sylvie (Liv Tyler), Jake attempts to reconstruct what happened the night of the murders before Tim is turned over to a less compassionate psychiatrist (John Lithgow) for more radical treatment. Their best shot: Tim's uncanny ability to remember and mimic conversations.
I don't think I'm breaking any new ground when I say that Richard Dreyfuss, talented though he may be, is a ham. And if there is anything more unintentionally amusing than watching a ham act, it is watching him try desperately *not* to be a ham. In SILENT FALL, director Bruce Beresford has Dreyfuss wandering around in a daze of what is supposed to be self-pity, but instead looks mostly like a particularly bad Hamlet. In the one scene where Dreyfuss plays Dreyfuss, rattling off multiple voices in an attempt to calm Tim, it's almost a relief. Unfortunately, that is the level at which Beresford has everyone pitch the performances; you only know they're alive because they blink. Linda Hamilton, energetic star of the TERMINATOR films, has the appallingly under-written role of Jake's oh-so-supportive wife, who struggles with dialogue like, "You're the one hiding from the world, Jake." Liv Tyler (daughter of Aerosmith's Steven Tyler in her first major role) is lovely, but lacks any screen presence, and her big emotional scenes are truly laughable. From start to finish, SILENT FALL is just so sluggish that I felt I was being hypnotized.
It's even harder to stay awake once you realize the preposterous story that you are being asked to swallow. First of all, no one from social services ever appears to guard Tim's interests, allowing the sheriff to treat him like a narcotics dog, expected to sniff out the murderer. Tim and Sylvie are allowed to return to their house, disturbing a crime scene of an investigation in progress. Most ridiculous of all is Tim's special talent, and not so much because it's impossible to believe his tape-recorder memory. Rather, it is the mimicked voices dubbed over Tim's lips which cross the line into silliness, and every time they are used they just get sillier.
 Ultimately there are only three suspects in SILENT FALL, and it tips its hand far too soon. What pass for attempts at diverting attention from the only real suspect fail miserably, and SILENT FALL is left to fall back on the developing relationship between Jake and Tim for any drama. While there are moments in that relationship which work quite well, they lead to the film's single most infuriating scene, a miracle cure for Tim at a crucial moment. For a film that wants to appear serious in its treatment of a perplexing medical condition, it traffics in solutions which are far too pat, and acts as a slap in the face to everyone who has ever had to live with autistic individuals by suggesting that all it takes to bring them out of it is just a little more love. And maybe the violent death of one or two family members.
On the Renshaw scale of 0 to 10 miracle cures: 2.
-- Scott Renshaw Stanford University Office of the General Counsel
.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
The challenge is not just that, women and gender minorities across the world bear brutal violence. It is that they have a vision, voice, and an agency to comment, reflect on some of the greatest crisis of our times: be it food security, national security, environmental justice, diplomatic relations.
Women have been at the forefront in movements for Dalit rights, minority rights, protection of forests, the right to food. Theirs is a unique, diverse struggle against inequality.
  In the village she worked outside her home. It was natural and necessary. The work was never recognised. The land she tilled tirelessly was never hers. The urban based woman goes through her own formidable challenges of negotiating hostile spaces.
Gender is the new conversation in these times. There is recognition, slow and grudging as it maybe, that gender must inform policy and planning.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Since the nationwide agitation over the 2012 Delhi gangrape, the media has offered a better platform to talk, question and debate issues around gender in India. Yet, most of the coverage around gender is restricted to sexual violence and crime. While these issues are important, they are also limiting in some way when we talk about women and other sexual or gender minorities in India.
Stories around gender need not be tucked away in one ‘women’s section’, in a book, on a website, in a magazine or in a policy file. A right to food policy or a land acquisition bill is as relevant to women and gender minorities as it is for men. The need of the hour is to mainstream gender in politics, business, national affairs and everything under the sun.
All of June, indianexpress.com will put out special stories with a gender lens, each looking at these intersections critically to assess how gender sensitive/inclusive anything in India is. Help us find more such stories using #GenderAnd in your conversations. You can read our reportage, here .


{{FAQ on "Buggy DNS"}}
{{If you were referred to this page by test-ipv6.com, it means that we were able to detect a dangerous condition with your DNS server.}}
{{First a description of the problem:}}
- {{Your browser asked for a DNS lookup, both IPv4 and IPv6.}}
- {{The IPv6 response was returned first.}}
- {{Your DNS server was confused by the result - it doesn't fully follow the DNS standards.}}
- {{Your DNS server took the first piece of the IPV6 address, and memorized it as the IPv4 address.}}
- {{The browser fails the IPv6 lookup, but "succeeds" in getting a bogus IPv4 address.}}
- {{It then tries to make a connecting, to the wrong address, with the wrong protocol.}}
{{This is bad for several reasons:}}
- {{You won't be able to connect to IPv6-only sites.}}
- {{You may sporadically fail (or always fail) to connect to IPv6-enabled web sites. This is regardless of whether you are capable IPv6 or not - you may still be impacted.}}
- {{Malicious people can recognize that specific IPv6 addresses, when matched with this bug, map to IPv4 addresses they control. Web sites you depend on can be spoofed; you would not know any better, unless the sites are using SSL.}}
{{You'll need to determine what device is forwarding your DNS queries.}}
{{ With Windows, at the cmd
prompt, you can type ipconfig /all
. Look for "DNS Servers
". }}
{{ With Linux, BSD, and Mac OS X, you can do this in a terminal: cat /etc/resolv.conf
. }}
{{ Residential ISP customers: look to see if the DNS server is <IP_ADDRESS> or <IP_ADDRESS>. If so, chances are good that your home router is at fault. This is probably the blue box you have that connects the Internet. }}
{{ Business customers: Provide this information to your IT professional to investigate. }}
{{IT professionals:}}{{You can see an illustration of this, by doing:}}
dig aaaa buggydns1.test-ipv6.com @<IP_ADDRESS>
dig a buggydns1.test-ipv6.com @<IP_ADDRESS>
{{ Substitute the <IP_ADDRESS> with the resolver being used by the host. If the "aaaa" request comes back with no answer, but the "a" answer does, this is a confirmation of a broken DNS cache or forwarder. The actual DNS information for buggydns1.test-ipv6.com has only an IPv6 record configured. }}


Gateway
BOT
25-Dec-19 07:49 PM
[dscrd-hush] <phm87> I agree that inflation have a different effect in each country : In Belgium, many things are indexed on inflation (estimated with different indexes) such as employee salaries, tax rate pivot points, social contribution pivot points and so on. The aim is then to redistribute the taxes with maximum transparency (Belgian have many data and analysis on the expenses of the govts, France is less transparent in comparison). These huge amounts of tax money are not centralized in 1 single govt but splitted to 7 entities that have their own separate budget, this system was very useful during 2008 crisis: the govts were limitated in their stupid choices.
[dscrd-hush] <dukeleto> very interesting, and different, than the US
[dscrd-hush] <phm87> There are special rules and limits to avoid nightmares as germany faced in the 1930's: Germany didn't pay to France some war debt money so France army occupied industrial centers (Rhur) then German govt was forced to pay salaries indexed on inflation BUT as no value was created from many industries, the German Mark value plunged leading to more bank notes printed and so on
[dscrd-hush] <phm87> The country is very little so the public debt grows each time that they need something big. As example, belgium need 16 airplanes F 35 or sth like this. US offers try to push to buy more things to have good prices ... so it happens that they call police, navy and unrelated corps to give them army stuff (super vehicules, helicopters, ...) because they were forced to buy it. US have also the argument that they own many companies in Belgium (if Belgium buy russian stuff, US companies established in Belgium may close or move)
[dscrd-hush] <phm87> BUT it is still very interesting to understand WHY so many companies unrelated to Belgium have headquarters or some buildings in Belgium : notional interests are one reason
[dscrd-hush] <phm87> In nearly all countries, if a company need to create a debt to invest in sth, the interest on the debt are deductible as professionnal expenses. If doesn't apply if the company use its own cash
[dscrd-hush] <Privatoshi> Look at Belgium on a map and you'll see why
[dscrd-hush] <phm87> So Belgium created a notional interest, fictive fiscal interest. If a company invest 100 000 € from its own money, it can deduce as pro expenses some fictional interest
[dscrd-hush] <phm87> yeah Belgium is tiny but there is Brussels into it and other stuff (beers)
[dscrd-hush] <Privatoshi> It is a very key location.
[dscrd-hush] <Privatoshi> In between France, England and Germany
[dscrd-hush] <Privatoshi> Not exactly, but you get my point
[dscrd-hush] <phm87> belgium is full of "nuggets" : SWIFT is in Be, odoo (created by a belgian), one small Belgian company that have 60% of world market on compressor to create plastic bottles
[dscrd-hush] <phm87> So, I'd like to play with notional interests and crypto, unsure how exactly but it can be cool
[dscrd-hush] <phm87> US is very different than Belgium and other European countries
[dscrd-hush] <Privatoshi> US is entirely different
[dscrd-hush] <Privatoshi> Culturally and fiscally
[dscrd-hush] <phm87> Few years ago, Will Smith the US actor was interviewed on French television. At the end, they asked his feeling about the new possible 70% rate of tax for the part of the salary above 1000 000 per year. He didn't understand the question at first then he was very shocked when he realized that it was a possible future reality in France
[dscrd-hush] <Privatoshi> US is Anglo-Latin Capitalist beast
[dscrd-hush] <phm87> Later, hopefully, the constitutional consil destroyed this 70% tax rate, saying it is unfair. In facts, few ppl are targetted by such laws and these persons have the money to change of country (Johnny Halliday was fiscally establied in Swiss paying max 500k € of tax per year)
[dscrd-hush] <phm87> About US, I agree that the market can be more efficient than centralized govt
[dscrd-hush] <phm87> But I still don't understand how it works about healthcare : we both agree that obamacare was more a problem than a solution. US doctors need to pay more insurances (because they are sued for random stuff) and are allowed to advertize, I didn't check numbers but I'm not sure that US healthcare system is more efficient in US
[dscrd-hush] <Privatoshi> Health Care is shit in U.S


Blocking in CSS allow for items to be placed side by side. Depending on how you want your webpage to look there are a couple of options when using blocking.
1. Inline blocking places the items in a line and keeps the height and width that they were programmed with. It allows other elements to sit to their left and right and respects top and bottom margins/padding.
display:inline-blocking;
2. Inline will place the items in the same row but override the width and height to make them all the same size.It respects left and right margins/padding but not top and bottom
display:inline;


| Android 4.4 | Android 5.1 | Android 6.0 | iOS 9.3 | iOS 10.0 | Windows 10 Store |
|---|---|---|---|---|---|
Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, WP8 and Blackberry 10. This plugin is based on Screen Orientation API so the api matches the current spec.
The plugin adds the following to the screen object (window.screen
):
// lock the device orientation
.orientation.lock('portrait')
// unlock the orientation
.orientation.unlock()
// current orientation
.orientation
cordova plugin add cordova-plugin-screen-orientation
The orientation is in the primary portrait mode.
The orientation is in the secondary portrait mode.
The orientation is in the primary landscape mode.
The orientation is in the secondary landscape mode.
The orientation is either portrait-primary or portrait-secondary (sensor).
The orientation is either landscape-primary or landscape-secondary (sensor).
orientation is unlocked - all orientations are supported.
// set to either landscape
screen.orientation.lock('landscape');
// allow user rotate
screen.orientation.unlock();
// access current orientation
console.log('Orientation is ' + screen.orientation.type);
Both android and iOS will fire the orientationchange event on the window object. For this version of the plugin use the window object if you require notification.
window.addEventListener("orientationchange", function(){
console.log(screen.orientation.type); // e.g. portrait
});
The 'change' event listener has also been added to the screen.orientation object.
screen.orientation.addEventListener('change', function(){
console.log(screen.orientation.type); // e.g. portrait
});
// OR
screen.orientation.onchange = function(){console.log(screen.orientation.type);
};
The screen.orientation property will not update when the phone is rotated 180 degrees.
Wraps the com.blackberry.app plugin functions, auto installed as a dependancy.
Windows phone does not support specification or primary and secondary orientations. If called with a specific orientation the plugin will just apply the landscape or portait orientation.
Windows 8.1 Applicaitons (runtime/metro applications) will only display orientation changes if the device has some sort of accelerometer. The internal state of the "orientation" will still be kept, but the actual screen won't rotate unless the device supports it.
See RELEASENOTES.md for the automated changelog.
Pull requests welcome.


Class: RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
TargetRubyVersion,
AutoCorrector,
Base
|
|
|
Instance Chain:
self,
RangeHelp,
Base
|
|
| Inherits: |
Base
|
| Defined in: | lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb |
Overview
Identifies places where slicing arrays with semi-infinite ranges
can be replaced by Array#take
and Array#drop
.
This cop was created due to a mistake in microbenchmark and hence is disabled by default.
Refer https://github.com/rubocop/rubocop-performance/pull/175#issuecomment-731892717
Constant Summary
-
MSG =
# File 'lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb', line 36'Use `%<prefer>s` instead of `%<current>s` with semi-infinite range.'
-
RESTRICT_ON_SEND =
# File 'lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb', line 39SLICE_METHODS
-
SLICE_METHODS =
# File 'lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb', line 38Set[:[], :slice].freeze
Instance Method Summary
-
#on_csend(node)
Alias for #on_send.
- #on_send(node) (also: #on_csend)
- #correction(receiver, range_node) private
Instance Method Details
#correction(receiver, range_node) (private)
[ GitHub ]# File 'lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb', line 66
def correction(receiver, range_node) method_call = if range_node.begin "drop(#{range_node.begin.value})" elsif range_node.irange_type? "take(#{range_node.end.value + 1})" else "take(#{range_node.end.value})" end "#{receiver.source}.#{method_call}" end
#on_csend(node)
Alias for #on_send.
# File 'lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb', line 62
alias on_csend on_send
#on_send(node) Also known as: #on_csend
[ GitHub ]# File 'lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb', line 52
def on_send(node) endless_range_slice?(node) do |receiver, method_name, range_node| prefer = range_node.begin ? :drop : :take = format(MSG, prefer: prefer, current: method_name) add_offense(node, message: ) do |corrector| corrector.replace(node, correction(receiver, range_node)) end end end


In a growth mindset students understand that their talents and abilities can be developed through effort, good teaching and persistence. They don’t necessarily think everyone’s the same or anyone can be Einstein, but they believe everyone can get smarter if they work at it.
Carol Dweck
This is interesting. I have loved reading about how one can develop a growth-mindset through
displaying one's ability. To quote the author, James Clear and his coach -
...starting small, proving your ability to yourself in a thousand tiny ways, and letting the
confidence and growth mindset naturally follow from there. Confidence is just displayed
ability.


We present below four demonstrations of the DAC-h3 cognitive architecture. They show how the system adapts to various environments (different robot, lab and human partner). In Demonstrations 2 and 3, the internal states of the robot are displayed in an inset for a better understanding of the robot's internal dynamics. Demonstrations 1 and 4 correspond to live demonstrations performed at the review meetings of the WYSIWYD European Project. Demonstration 1 is the most complete, showing all the abilities of the current HRI system.
The robot is self-regulating two drives for knowledge acquisition and expression. Acquired information is about labeling the perceived objects, agents and body parts, as well as associating body part touch and motor information. In addition, a number of goal-oriented behaviors are executed through human requests: passing objects, showing the learned kinematic structure, recognizing actions, pointing to the human body parts. A complex narrative dialog about the robot's past experiences is also demonstrated at the end of the video.
The robot is self-regulating two drives for knowledge acquisition and expression. Acquired information is about labeling the perceived objects and associating body part touch and motor information. In addition, a number of goal-oriented behaviors are executed through human requests: taking an object, showing the learned kinematic structure, expressing a narrative. The goal for taking an object is executed twice, showing how the action plan execution adapts to the initial state of the object.
The inset in the top right part of the screen displays information about the current state of the robot. From left to right:
The robot is self-regulating two drives for knowledge acquisition and expression. Acquired information is about labeling the perceived objects, agents an body parts, as well as associating body part touch and motor information. In addition, a number goal-oriented behavior is executed through human requests for taking and giving an object.
The inset in the top right part of the screen displays information about the current state of the robot. From left to right:
The robot is self-regulating two drives for knowledge acquisition and knowledge expression. Acquired information is about labeling the perceived objects, agents an body parts, as well as associating body part touch and motor information. In addition, a number of goal-oriented behaviors are executed through human requests: showing the learned kinematic structure, expressing a narrative, recognizing an action, and playing with a ball.
Compared to the two previous demonstrations above, this video was recorded with another iCub robot, in a another lab and with another interacting human, demonstrating the robustness of the system to varying conditions.


New Irish doctor on Grey's Anatomy has fans swooning
by IrishCentral StaffThere's a hot new Irish doctor at Grey Sloan Memorial. The newest addition to Grey's Anatomy has fans swooning.
(Warning spoilers ahead!)
The mid-season fall finale of the long-running medical drama had Cristina sending Meredith, now back at Grey Sloan, a congratulatory present all the way from Switzerland.
Read More: This is the new Irish crime drama you have to see
Meredith assumes the package is an object, never realizing the present is actually Dr. Cormac Hayes, the new Chief of Pediatric Surgery at the hospital.
Dubbed “McWidow” by Cristina because he lost his wife, the hot new
Irish doctor and Grey have already clashed. Nonetheless, it is apparent Hayes is destined to be Meredith’s newest love interest.
Dr. Hayes is played by Irish actor Richard Flood. The 37-year-old from Dublin has previously starred in Shameless and TV3’s Red Rock.
Since the fall finale last week, fans of the show have been taking to social media to share their love for the handsome doctor, reports Her.ie.
"I already love McWidow," wrote one fan, while another said, "Congratulations, it is already obvious you will be an amazing addition to the show!"
"Grey’s Anatomy has me falling for an Irish man," someone commented.
Read More: Irish actor Moe Dunford's breakthrough year has arrived
Said another: “It sounded like this new doctor on Grey’s had an Irish accent and I’m swooning already.”
Grey’s Anatomy returns to ABC in Jan. 2020.


Extensions
The following extensions are available globally.
-
Declaration
Swift
extension Optional: CustomStringConvertible
extension Optional: OptionalType
public extension Optional where Wrapped: Collection
public extension Optional where Wrapped == String
public extension Optional where Wrapped == Data
public extension Optional where Wrapped: Occupiable
public extension Optional where Wrapped: Collection & Occupiable
public extension Optional where Wrapped: InitializeableOccupiable
-
Declaration
Swift
public extension CGPoint
-
Declaration
Swift
public extension CGRect
-
Declaration
Swift
public extension Bool
-
Declaration
Swift
public extension Collection where Index == Int
public extension Collection where Self: Occupiable
-
Declaration
Swift
public extension Data
-
Declaration
Swift
public extension Date
-
Declaration
Swift
public extension DateComponents
-
Declaration
-
Declaration
Swift
public extension Double
-
Declaration
Swift
public extension Error
-
Declaration
Swift
public extension FileManager
-
Declaration
Swift
public extension Float
-
Declaration
Swift
public extension FloatingPoint
-
Declaration
Swift
public extension Int
-
Declaration
Swift
public extension Int32
-
Declaration
Swift
public extension NSAttributedString
-
Declaration
Swift
public extension NSCoder
-
Declaration
Swift
public extension NSMutableAttributedString
extension NSMutableAttributedString: InitializeableOccupiable
-
Declaration
Swift
public extension NotificationCenter
-
Declaration
Swift
public extension RangeReplaceableCollection
public extension RangeReplaceableCollection where Element: Equatable
public extension RangeReplaceableCollection where Self: BidirectionalCollection
public extension RangeReplaceableCollection where Index == Int, Self: BidirectionalCollection
public extension RangeReplaceableCollection where Element: Equatable, Self: BidirectionalCollection
-
Declaration
Swift
public extension Sequence
public extension Sequence where Element: Equatable
public extension Sequence where Element: BinaryFloatingPoint
public extension Sequence where Element: Occupiable
public extension Sequence where Element: OptionalType
-
Declaration
-
Declaration
Swift
public extension StringProtocol
-
Declaration
Swift
public extension TimeZone
-
Declaration
Swift
public extension Timer
-
Declaration
Swift
public extension UInt
-
Declaration
Swift
public extension URL
-
Declaration
Swift
public extension URLComponents
-
Declaration
Swift
public extension UserDefaults
-
Declaration
Swift
public extension RandomAccessCollection
-
Declaration
Swift
public extension UIBarButtonItem
-
Declaration
Swift
public extension UIButton
-
Declaration
Swift
public extension UICollectionView
-
Declaration
Swift
public extension UIColor
-
Declaration
Swift
public extension UIDevice
-
Declaration
Swift
public extension UIImage
-
Declaration
Swift
public extension UIImageView
-
Declaration
Swift
public extension UINavigationBar
-
Declaration
Swift
public extension UINavigationController
-
Declaration
Swift
public extension UIRefreshControl
-
Declaration
Swift
public extension UIScrollView
-
Declaration
Swift
public extension UIStackView
-
Declaration
Swift
public extension UIStoryboard
-
Declaration
Swift
public extension UITableView
-
Declaration
Swift
public extension UIViewController
-
Declaration
Swift
public extension UIWindow
-
Declaration
Swift
public extension WKWebView
-
Declaration
Swift
public extension MFMailComposeViewController
extension MFMailComposeViewController: MFMailComposeViewControllerDelegate
-
Declaration
Swift
public extension MFMessageComposeViewController
extension MFMessageComposeViewController: MFMessageComposeViewControllerDelegate
-
Declaration
Swift
extension Array: InitializeableOccupiable
-
Declaration
Swift
extension Set: InitializeableOccupiable
-
Declaration
Swift
extension NSMutableString: InitializeableOccupiable
-
Declaration
Swift
public extension NSLayoutConstraint
-
Declaration
Swift
public extension UIFont
-
Declaration
Swift
public extension UILabel
-
Declaration
Swift
public extension UITextView
-
Declaration
Swift
public extension UITextField