August 20, 2019
August 18, 2019
Ali Haydar - Implement more annotation support: labels, notes, and dimensions #28
Ziya Erkoç - Integrating PathwayMapper into cBioPortal and Separating the Network View as a standalone module
Hasan Öztürk - Proposal for Atlas Experiment
Baskın Burak Şenbaşlar - Improvements of the Surface Mesh Simplification package
Necip Fazil Yıldıran - Make OpenGR be able to work directly with CGAL point clouds
Caner Akdaş - Advanced Node, Edge, Arrow Plugin Library
Fahrican Koşar - Optimization of VPR File Formats
Enis Kollugil - Vscode Snippets For Syslog-ng
Recep Ahmet Sarıtekin - TensorFlow Datasets - Implement new features in TFDS for users and developers
Arda Akdemir - De-Bruijn Graph Constructor Package for De-novo Genome Assembly
Meraklısı için: 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
August 17, 2019
August 16, 2019
August 15, 2019
Linux file server is one of the powerful servers that helps you to share files and printers with Windows-based PCs and other operating systems. Before we talk about using Samba as a file server, let’s discuss some basics. To understand Linux/Samba/Windows relationship, you need to understand the relationships of the operating systems, users, and networks. Linux login system is different from the Windows login system. So, it’s the system administrator job to maintain the logins between different platforms. There are several solutions to do this: Linux pluggable authentication modules (PAMs): there are two user lists, one local list and one on the domain controller (DC), and users need to maintain their passwords only on the Windows system.
- Samba as a DC: you maintain usernames and passwords on the Linux system, and users can log in to Windows boxes with Samba
- Custom script: you can create scripts for maintaining logins and passwords, this can be done using a cross-platform scripting language like python.
The samba server composed of several components and daemons, the three main daemons are smbd, nmbd, and winbindd.
- The smbd daemon is the main service for the sharing of files and printers. This daemon uses port 139 or 445 to listen for requests.
- The nmbd daemon handles NetBIOS name service requests. This daemon uses port 137 to listen for requests.
- The winbindd is used to get user and group information from Windows.
To install Linux file server, you need to install three packages.
For Red Hat based distros, you can install them like this:
dnf -y install samba
This package installs SMB server.
dnf -y install samba-common-tools
This package includes the required files for both the server and client.
dnf -y install samba-client
For Debian based distros, you can install them like this:
apt-get -y install samba
apt-get -y install samba-common-tools
apt-get -y install samba-client
Then you can start samba service and enable it at startup:
systemctl start smb
systemctl enable smb
Samba File Sharing
Of course, you can use web-based or GUI utilities to manage your Linux file server. However, it is useful to understand what GUI or web tools are doing from behind.
Now we will share a folder named myfolder:
chmod -R 755 myfolder
Open up Samba configuration file /etc/samba/smb.conf and add the following lines at the end:
The first line is the Samba server name that the clients see.
The second line is the path to the folder that will be shared.
The third line means the share will available to all users like guest account and others. If set to no, authenticated and permitted users are only allowed.
The fourth line means that you cannot create or modify the stored files on the shared folder.
You can check for SMB configuration errors using the testparm command:
Now restart SMB service:
systemctl restart smb
Now we need to access what we’ve shared. The smbclient utility is used to access Windows shared files.
You can list the shared files like this:
smbclient -L localhost -U%
The -U% option is used to avoid asking for the password.
As you can see our shared folder is on the list.
You can access this shared folder from Windows by just typing the IP address in the Windows explorer.
You can list a specific directory using the smbclient tool like this:
smbclient -U% //192.168.1.2/My_Folder
Once you’ve connected, you can use Linux commands to list and travel between files.
You can transfer files using get, put, mget, and mput commands.
If you are using iptables firewall, don’t forget to allow the ports 137,139 and 445.
Most Linux kernels support SMB file system.
To mount a Samba share, First, create a mount point:
Then we mount the SMB shared folder:
mount -t cifs -o guest //192.168.1.2/My_Folder /mnt/smb
If the shared folder is password protected, then you type the username and password:
mount -t cifs username=likegeeks,password=mypassword //192.168.1.2/My_Folder
To unmount the SMB shared folder, use the unmount command like this:
On Debian based distros, you might need installing the cifsutils package in order to use it:
apt-get -y install cifs-utils
Creating Samba Users
To create a samba entry for an existing system user, use the pdbedit command:
pdbedit -a likegeeks
The new user will be created in the Samba default user database which is /var/lib/samba/private/passdb.tdb file.
With a Samba user created, we can make the shares available only to authenticated users like the user likegeeks.
This user can access his resources on Samba server using smbclient like this:
smbclient -U likegeeks -L //192.168.1.3
The smbpasswd command is used to change the SMB password like this:
Authenticate Users Using Windows Server
The winbindd daemon is used for resolving user accounts information from native Windows servers.
First, install the winbind package.
dnf -y install samba-winbind
Then start the service like this:
systemctl start winbind
Then add the following options in /etc/samba/smb.conf file:
Then Edit the /etc/nsswitch.conf file and modify the following lines:
passwd: files winbind
shadow: files winbind
group: files winbind
Then Edit the /etc/resolv.conf file and change the primary DNS server:
Now join the Linux Samba server from the Windows domain using the net command:
net join -w WINDOWS-DOMAIN -s ' win-server' -U Administrator%password
You can list the users in the Windows domain using wbinfo command
For any problem diagnostics, you can check the samba log files under /var/log/samba/ directory, also use testparm utility to check your configuration after you modify the samba configuration file.
That’s all. I hope you find the Linux file server easy. Keep coming back.
En iyi açık kaynak kodlu ve özgür video editörlerinden biri olan LiVES video editor, GNU General Public License v3 ile lisanslanmıştır. LiVES video editor, şu an için 3.0.1 sürümüne güncellenmiş bulunuyor. Bu güncelleme ile istenmeyen kilitlenmelerin önlendiği, video kaydının optimize edildiği, çevrimiçi video indiricisinin daha kullanışlı hale getirildiği söyleniyor. Daha pürüzsüz oynatmayı içeren openGL oynatma eklentisindeki iyileştirmelerle gelen sürümde, oynatma eklentisi için gelişmiş seçeneklerin yeniden etkinleştirildiği ifade ediliyor. Geniş kapsamlı ana arayüzün yeniden yazıldığı, kodun temizlendiği ve birçok görsel iyileştirme yapıldığı söyleniyor. Musl libc için destek eklenen sürümde, Ukraynaca için çeviri güncellemesi yapılmış. LiVES, genellikle pek çok GNU/Linux dağıtımının deposunda vardır. Ancak, bu yazıda yazılımı manuel olarak kurmak ihtiyacında olanlar hedeflenmiştir.
Manuel olarak kurmak isteyenler kimi dağıtımlara uygun paketleri, mesela Fedora ve Open SUSE için RPM paketlerini indirme sayfasında bulabilirler. Bu nedenle indirme sayfasını incelemeniz önerilir. Ubuntu ya da Ubuntu tabanlı dağıtımlarda ise kurulum, PPA deposu aracılığıyla olur. Buna göre, öncelikle PPA deponun sistem kaynaklarına eklenmesi gerekir:
sudo add-apt-repository ppa:ubuntuhandbook1/lives
Ardından depolarımızı güncelliyoruz:
sudo apt update
Son olarak, LiVES video editor’u yüklüyoruz:
sudo apt install lives lives-plugins
Güle güle kullanın.
The Linux virtual file system or virtual file system generally is a layer that sits on the top of your actual file system which allows the user to access different types of file systems, you can think of virtual file system as an interface between the kernel and the actual file system. That means you will not find any entries for those Linux virtual filesystems in your /etc/fstab file. Yet, you will still find them when you type the mount command. If you are coming from Windows, the virtual file system is the Registry. The proc file system is a virtual file system which is mounted on /proc directory. There is no real file system exists on /proc, it’s a virtual layer that is used for dealing with the kernel functionalities.
/proc File System
For example, to get the processor specifications, type the following command:
This is a very powerful and easy way to query Linux kernel.
Notice that if you check the size of the file in /proc directory, you will find that all file sizes are 0, because as we said they don’t exist on the disk.
When you type cat /proc/cpuinfo command, a file is dynamically created to show you the CPU info.
The only file that has a size in /proc directory is /proc/kcore file, which shows the RAM content. Actually, this file isn’t occupying any space on the disk.
Writing to Proc Files
As we’ve seen, we can read the content of proc files, but some of them are writable, so we can write to them to change some functionality.
For example, this /proc/sys/net/ipv4/ip_forward file controls IP forwarding in case you have multiple network cards.
You can change the value of this file like this:
echo "1" > /proc/sys/net/ipv4/ip_forward
Keep in mind that when you change any file or value under /proc directory there is no validation of what you are doing, you may crash your system if you type a wrong setting.
Persisting /proc Files Changes
The previous modification to the /proc/sys/net/ipv4/ip_forward entry will not survive after rebooting since you are not writing to a file, this is a virtual file system, means change happens to the memory.
If you need to save changes under /proc, you have two ways:
You can write your entries in /etc/rc.local file, or in Red Hat based distros like CentOS, create /etc/rc.d/rc.local file and make it executable and enable the systemd service unit that enables the use of the rc.local file and write your entries.
The sysctl command is used to change entries in /proc/sys/ directory.
This will show the value of the entry, to change it, use the -w option:
sysctl -w net.ipv4.ip_forward=1
One final step is to write the changes to /etc/sysctl.conf:
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
Make sure that the file /etc/sysctl.conf does not contain the entry before you write your changes.
Common /proc Entries
These are some of the commonly used /proc entries:
/proc/cpuinfo information about CPUs in the system.
/proc/meminfo information about memory usage.
/proc/ioports list of port regions used for I/O communication with devices.
/proc/mdstat display the status of RAID disks configuration.
/proc/kcore displays the system actual memory.
/proc/modules displays a list of kernel loaded modules.
/proc/cmdline displays the passed boot parameters.
/proc/swaps displays the status of swap partitions.
/proc/iomem the current map of the system memory for each physical device.
/proc/version displays the kernel version and time of compilation.
/proc/net/dev displays information about each network device like packets count.
/proc/net/sockstat displays statistics about network socket utilization.
/proc/sys/net/ipv4/ip_ display the range of ports that Linux uses.
/proc/sys/net/ipv4/ protection against syn flood attacks.
These are some of the common entries in /proc directory.
Listing /proc Directory
If you list the files in /proc directory, you’ll notice a lot of directories which have numeric names, these directories contain information about the running processes and the numeric value is the corresponding process ID.
You can check the consumed resources by a specific process from these directories.
If you take a look at the folder named 1, it belongs to the init process or systemd (like CentOS 7) which is the first process runs When Linux starts.
ls -l /proc/1
The /proc/1/exe file is a symbolic link to /lib/systemd/systemd binary or /sbin/init in other systems that use init binary.
The same concept applies to all numeric folders under /proc directory.
/proc Useful Examples
To protect your server from SYN flood attack, you can use iptables to block SYN packets.
A better solution is to use SYN cookies. A special method in the kernel that keeps track of which SYN packets come. If the SYN packets don’t move to established state within a reasonable interval, the kernel will drop them.
sysctl -w net.ipv4.tcp_syncookies=1
And to persist the changes.
echo "net.ipv4.tcp_syncookies = 1" >> /etc/sysctl.conf
Another useful example which is the /proc/sys/fs/file-max, this value shows the maximum files (including sockets, files, etc,) that can be opened at the same time.
You can increase this number like this:
sysctl -w "fs.file-max=96992"
echo "fs.file-max = 96992" >> /etc/sysctl.conf
sysfs Virtual File System
sysfs is a Linux virtual file systems which mean it’s also in memory.
sysfs file system can be found at /sys. The sysfs can be used to get information about your system hardware.
ls -l /sys
From the result of the above command, the file sizes are all zero because as we know this is a Linux virtual file system.
The top level directory of /sys contains the following:
Block list of block devices detected on the system like sda.
Bus contains subdirectories for physical buses detected in the kernel.
class describes class of device like audio, network or printer.
Devices list all detected devices by the physical bus registered with the kernel.
Module lists all loaded modules.
Power the power state of your devices.
tmpfs Virtual File System
tmpfs is a Linux virtual file system that keeps data in the system virtual memory. It is the same like any other Virtual File Systems, any files are temporarily stored in the Kernel’s internal caches.
The /tmp file system is used as the storage location for temporary files.
The /tmp file system is backed by an actual disk-based storage and not by a virtual system.
This location is chosen during Linux installation.
The /tmp is created automatically by systemd service when booting the system.
You can setup tmpfs style file system with the size you want, using the mount command.
mount it tmpfs -o size=2GB tmpfs /home/myfolder
Working with Linux virtual file system is very easy.
I hope you find the post useful and interesting. Keep coming back.
August 14, 2019
In this tutorial, we will talk about Linux web server or Apache web server specifically and how to install it and configure it to serve your content to others. A web server is a system that manipulates requests via HTTP protocol, you request a file from the server and it responds with the requested file, which might give you an idea that web servers are only used for the web. Actually, web servers can also be found embedded in devices such as printers, routers, when you open your router configuration page, there is a web server behind it. When you open the printer configuration page, there is also a web server behind it serving your requests, so web servers are important today because they are used everywhere. First, your browser sends a request to the server.
How Web server Works
First, your browser sends a request to the server.
The server takes the requested file or page from you and maps it to the corresponding file from the server. The server sends the file back to the browser with some information such as its MIME type, the length of the content and some other useful information.
Sometimes the requested file is a static page like HTML pages or dynamic pages like PHP, Java, Perl or any other server-side language.
For example, when you type www.yourDomain.com, the browser queries the DNS server about the IP address of the computer: www.yourDomain.com. Once the browser gets the response from the DNS, it starts a TCP connection on port 80 and asks for the default web page, then this page is sent to you and that’s all.
Linux Web server Implementations
There are many Linux web server implementations available for you to use:
- Apache server
- Apache Tomcat
- Monkey HTTP Daemon (used especially for embedded systems)
There are more Linux web servers, but this list is the most used web servers.
The most used web servers are Apache and Nginx.
In this post, we will use Apache server for several reasons:
- It is stable.
- It is flexible.
- It is secure.
We’ll install and configure Apache server on Linux, but at first, let’s review some of the basics of HTTP protocol basics.
When you request a file or a page from a web server, the client at first connects to the server on port 80. After successful connection, the client then sends HTTP commands (also methods) to the server. This command includes a request header which includes information about the client.
To view these request headers in chrome, open chrome devtools, then open network panel and visit google.com and check the request headers, you should see something like this:
The request header also includes information about the client, like the user agent and the accepted formats.
Additional information may be sent with the request header. For example, if you click on a link that will open another website, the header will include the referral site.
After receiving the request header completely, the server responds with the requested file or page along with a response header.
The response header includes information about the received content, its type, and other information.
You can check the response headers from the browser network panel.
Install Apache Web server
You can install Apache server on Red Hat based distros using the following command:
dnf -y httpd
Or if you are using a Debian-based distro, you can install it like this:
apt-get -y install apache2
The Apache web server service is called httpd on Red Hat based distros like CentOS, while it is called apache2 in Debian based distros.
If you are using a firewall like iptables, you should add a rule for port 80.
iptables -I INPUT 1 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Or if you are using firewalld, you can use the following command:
To start your service and enable it on boot:
systemctl start httpd
systemctl enable httpd
You can check if your service is running or not, using the following command:
systemctl status httpd
Now open your browser and visit http://localhost or http://[::1]/ if you are using IP v6 and if your installation goes well, you should see your HTML homepage.
Configuring Apache Web server
You can add files to Apache in the /var/www/html directory for top-level pages.
Just remember to make sure that any files or directories placed in that directory are world-readable.
The default index page is index.html.
The Apache configuration files are in /etc/httpd/conf/ directory.
On Debian based systems like Ubuntu, you may find it at /etc/apache2/apache2.conf file.
We can’t discuss every option for Apache on a single post, but we will discuss the most important options.
You call them options or directives.
This option specifies the configuration folder for Apache web server. On Red Hat based distros, the ServerRoot option is /etc/httpd/ directory. On Debian distros the ServerRoot option is /etc/apache2/.
This is the port that Apache web server will use to wait for incoming connections.
The default value for this option is 80 for nonsecure connections and 443 for secured connections.
If you have multiple IP addresses on your server, you can assign which IP should listen for connection using Listen option.
You can specify a different port other than 80, just make sure that it’s not in use.
You can run many HTTP servers on the same hardware every one on a unique port.
When a server runs on a non-standard port such as port 8080, it will require the port number to be explicitly stated like this:
This option specifies the hostname of the web server that appears to the visitors.
This defines the path that will contain your files that will be served.
The default path is /var/www/html .
This option sets the maximum number of concurrent connections that the server will receive.
This option is used to load modules into Apache web server.
There are a lot of Apache modules like these:
mod_cgid: This module is used to run CGI scripts using Apache web server.
mod_ssl: Provides secure connections via SSL and TLS protocols.
mod_userdir: This module allows you to serve content from users specific directories.
If you want to disable loading a specific module, you can comment the Load module line that contains that module.
Or if you use Debian based distros like Ubuntu, you can use these commands:
This command to enable the module.
This command to disable the module.
All these commands do is create a symlink under /etc/apache2/mods-enabled directory with the file that contains the module you want to enable. All files under this directory are included in Apache configuration by default, so any file will exist in this directory will be included.
And if you use a2dismod, the symlink will be removed.
If you enable or disable a module, you have to reload or restart Apache web server.
This option allows you to include other configuration files.
You can store all the configuration for different virtual domains, and Apache will include them at runtime.
This option specifies the directory that will contain the files that will be accessible via the web server. This directory is usually named public_html and its location in user’s home directory.
For example, if you have a user adam who wants to make his web content available via Apache web server.
First, we make a public_html folder under his home directory.
Then set the permission for the public_html folder:
chmod 644 public_html
Now if we put an index.html file, it will be accessible via the browser like this:
This option specifies the location of the files that are outside the DocumentRoot location and need to be served by the Apache web server.
Like you have files outside DocumentRoot and you want them to be available to the visitors.
Alias URL_Path Actual_Path
This option specifies the error log file for Apache web server.
This option allows you to host multiple websites on the same server.
The idea is that the content is served based on the requested hostname.
To setup a virtual host for the host www.example.com. First, create a VirtualHost option in /etc/httpd/conf/httpd.conf file.
And specify the DocumentRoot and ServerName like this:
Keep in mind that the ServerName option must be resolvable via DNS.
These are the most used Apache options.
Virtual Host Types
There are two types of virtual hosts that you can define in Apache web server:
- Name-based virtual hosts
- IP-based virtual hosts
The NameVirtualHost directive defines which addresses can be virtual hosts; the asterisk (*) means any name or address on this server. You can write them like this:
DocumentRoot “/ home/user2/public_html/”
If you have more than one IP address and you want to use SSL certificate, the website must be on a dedicated IP address. You can write IP-based virtual hosts like this:
DocumentRoot “/ home/user2/public_html/”
Apache Process Ownership
We know from the Linux process management that each process inherits its permissions from its parent process.
This fact is true for all processes except for applications with the SETUID bit set, they inherit permissions from the owner, not the parent process. A good example is the /bin/su.
If a normal user runs /bin/su program, it does not inherit the permission from adam, but it acts as a root user running it.
Since Apache web server needs to bind port 80, and this needs root privileges.
After binding to port 80, Apache can run as a normal user and only read files that have permissions to read them.
Based on the Linux distro you use, the user could be one of the following:
nobody, www, apache, www-data, or daemon.
I delayed introducing two more options for apache till reaching that point.
This specifies the user ID which the web server will use to answer requests.
This specifies the group that Apache web server will use to read files.
Security is very important for sites that use executable scripts such as CGI or PHP scripts.
The user you will use will have the permission to read and write the content of all sites on the server. But we want to ensure that only the members of a particular site can read their own site only.
This is very important because if a site got compromised, the attacker will be able to read all files since the apache user has permission to do that.
So how to solve this problem?
A popular method is to use suEXEC. suEXEC is a program that runs with root permissions and makes CGI programs run as the user and group IDs of a specific user, not the Apache server user.
You can specify the user on each virtual host like this:
SuExecUserGroup adam adamGroup
Just that simple.
You may want to restrict some parts to specific visitors. It’s like a password protected directory.
In Apache, you can store authentication information file called .htpasswd file.
You can use the htpasswd command to do that.
First, create the .htpasswd file using the htpasswd command:
htpasswd -c /home/adam/.htpassswd myuser
The -c option is needed the first time you run htpasswd, but when you need to add more users you shouldn’t use -c because it will overwrite the file.
Then create a .htaccess file in the public_html folder and write the following:
AuthName is required, you can use any string you want.
AuthType Basic says that you’re using htpasswd style user file.
AuthUserFile points to the file that contains the generated password from htpasswd command.
The Order line indicates that Apache must deny access by default, and only allow access for users specified in the htpasswd file.
The require directive means any user in the .htpasswd file is allowed.
Troubleshooting Apache Web server
If you modify the httpd.conf file and restart or reload Apache web server and it did not work, then you have typed a wrong configuration, however, this is not the only case that you need to troubleshoot Apache, you may look at the apache logs to see how the service works so you can diagnose the problem and solve it.
The two main log files for apache are error_log and access_log files.
You can find these files in /var/log/httpd/ directory in Red Hat based distros, or in /var/log/apache2/ directory if you are using Debian based distros.
The access_log file contains every request to Apache web server with the details about client requested that resource.
The error_log file contains errors of Apache web server.
You can use tail command to watch the log file:
tail -f /var/log/httpd/error_log
I recommend you to review the Linux syslog server to know more about logging.
I hope you find working with Apache web server easy and interesting. Keep coming back.