Welcome to LinuxScrew

A site for Linux lovers worldwide. For newbies, system engineers, administrators, and everybody in between. We cover all things Linux, plus various programming languages, including Python, Javascript, and PHP.

View our featured tutorials and projects in the slider below or scroll down to see all recent articles.

How to Convert a USB Printer to Wireless with a Raspberry Pi
How to Use a Raspberry Pi for Digital Signage
The Worst Things You’ll Probably Google As a Programmer on Linux
How to Build a Raspberry Pi Internet Kiosk
Browsing the Internet on a 1989 Macintosh II with a Web Rendering Proxy
previous arrow
next arrow
Slider

DIY Raspberry Pi Laptop/Palmtop Computer [Kitchen Build]

DIY Raspberry Pi Palmtop

There was once a PC form factor known as the ‘Palmtop’ and it was good. Then, tablets appeared and pretty much wiped them out completely. I am still a huge fan of palmtops – they’re great for travel or getting some light work done in the park without having to lug about a full laptop, try and type on a tablet screen, or trying to angle those awful tablet keyboard cases on your lap so that they don’t collapse. There are a few modern attempts … Read more

Making POST Requests with cURL

post requests curl

cURL is a package that contains various tools for transferring data between remote servers. It supports FTP, Windows Shares, Mail Servers, and of course Web Servers using HTTP. Downloading a file from the Linux shell is usually accomplished using the cURL command like so: curl http://example.org/file.zip –output file.zip This makes the request for the file using the GET method and simply downloads it. This article will detail how to use cURL to make a POST request, including form data. This may be useful if the server requires … Read more

Boolean Operators: Comparing Values in Python

Boolean Operators in python

Python is widely used for both scripting and automation on Linux, as well as building web and standalone applications. Python is designed to be easy to learn, easy to write, and easy to read. It’s a great multi-purpose programming language. Boolean Values This article covers how boolean operators work in Python. In programming, a boolean value is either TRUE or FALSE. When comparing values in Python, a boolean value is returned allowing you to store the result of the comparison, or take a certain action … Read more

How to Search in Vim Text Editor

How to Search in Vim

This article explains how to search for words and expressions using Vim. Vim is ubiquitous, some tips and tricks can help you in everyday work life. So! Let’s explore simple searching, with Vim. Find a string Starting in normal mode, press forward-slash (/). Type in the string you’re looking for, and press enter. Press n to find the next occurrence. Once you reach the bottom, Vim loops back to the top. Reverse Search If you want to find all previous occurrences of a word, use … Read more

Linux cd Command: Change Directory

Linux cd Command Change Directory

This tutorial explains how to use the cd command in Linux to change the directory you are currently in, within the shell. We’ve previously covered how to look around in directories with ls. But now you need to start navigating around the directories. We’ll do that easily with cd, change directory. Let’s start with something simple, how do we learn more about simple baked in utils like cd? If you try: man cd It’ll report, “No manual entry for cd”. Most likely. Instead for baked … Read more

Linux chmod Recursive: How to Change File Permissions Recursively

Linux chmod Recursive

With the Linux chmod command, we can recursively change file permissions on all files and directories. This guide explains how. It’s likely you’ve run into the following errors before: 111 [Permission Denied] “Linux-Screw” [Permission Denied] “Linux-Screw” [readonly] For any system files, using sudo is the preferred way of editing a file. This allows you to keep all the system context. For everyday use with user files, it’s best to change permissions. chmod can do that for us. It keeps us from needing to escalate permission … Read more

PHP in_array Function: Check Array Values Exist

PHP in_array Function

The PHP in_array() function allows you to check for the presence of a value in an array, and take an option based on this result. Syntax in_array ( $needle , $haystack [, $strict = FALSE ] ) Note That: $needle can be a variable of any type (string, number, date, etc) $haystack should be an array (see here, here, and here for more about arrays) $strict is optional, and will ensure that the type of values is also compared when checking whether $needle is present If $strict is FALSE (the default behavior), the number … Read more

Categories PHP

Vim: How to Find and Replace

vim find and replace

This tutorial explains how to find and replace words in Vim/Vi. Vim provides the substitute command, similar to sed, for replacing text. Let’s go through and look at your options for finding and replacing text in this popular Linux text editor. Vim Syntax #from :help substitute :[range][substitute]/[pattern/{string}/[flags][count] For each line in [range] replace a match of {pattern} with {string}. For the {pattern} see pattern “:help pattern”. For instance if you wanted to replace all instances of Nov & Dec with Jan. :%s/Nov\|Dec/Jan/G When [range] and … Read more

Linux Change User Password (passwd)

Linux Change User Password

This tutorial explains how to use the Linux passwd command to change a user password or disable an account. You’re assigned a ticket: A simple password reset, but it’s for a Linux machine. What do you need to know to reset a password on Linux? First the basics. For users, the passwd authentication token is store in the /etc/shadow file. For groups, it’s stored in the appropriately named /etc/gshadow file. passwd allows you to change passwords for either. The normal usage of passwd is: Reset … Read more

Using the PHP Array ‘implode’ Function, with Examples

php implode function

We’ve previously covered the explode() function in PHP – now it’s time for implode()! This tutorial will teach you how to merge values from an array into a single string using the PHP implode() function. Processing data for presentation to the end-user is one of the common PHP tasks. PHP is frequently used on Linux to display database query results to the user. If some of those values are stored in an array, you may want to merge them into a single string for ease of display or brevity … Read more

Categories PHP