You are reading the article How To Play Mp3S From The Linux Command Line updated in October 2023 on the website Benhvienthammyvienaau.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested November 2023 How To Play Mp3S From The Linux Command Line
At first, this may sound pointless. After all, aren’t there dozens of perfectly good GUI music apps out there? Haven’t we all found something we like, or at least don’t hate? Perhaps that’s true, but how much happier would you be if your music app of choice used a whole lot less resources? Or what if you could type in a command on your laptop from anywhere, and have music start playing from the speakers on your desktop? If you’re in to pranks, that works just as well on a friend/co-worker’s computer. Today’s topic is mpg123, an app which can (among other things) make a great GUI-free media player.
Get the appJust about any Linux distribution with online repositories will have this package available, normally as just mpg123. Ubuntu users can find it in the Software Center or from the command line with
sudo
apt-get install
mpg123In the event that your distribution does not have binaries available, you can download the source code here.
The BasicsA single track can be played in a simple and pretty obvious way, just mpg123 followed by the filename, as in:
mpg123 MySong.mp3Which will play the single track from start to finish with output something like this:
PlaylistsYou can also use shell wildcards to send mpg123 several files at once. The simplest example is to use the above method, but replace the filename with a quick and easy *.mp3.
mpg123*
.mp3To set your playlist to shuffle mode, just add a -Z in there
Optionally, you can use normal bash redirect characters to feed mpg123 a list of filenames.
ssh
username@
my-remote-machine-address mpg123-Z
-@
<
myplaylistfileThe -@ flag tells mpg123 to treat the following input as a playlist (it’s the shortened form of –list), and the < is a standard bash redirect to pull the text out of the file and use it as mpg123‘s input.
Remote Play ControlThis isn’t exactly a “feature” of mpg123, it’s more like a side effect, but for this author, it’s the most handy thing about this application. You see, regular readers or Linux pros probably already know about SSH, the fantastically useful remote shell application with 1001 uses. Since SSH gives you a shell on a remote machine, you can run programs on that remote machine. As mpg123 is just another shell application, the normal rules apply. If you SSH into a machine and run mpg123, it will play out that machine’s speakers.
This is great for me. If I’m sitting on the porch with my netbook on a fine summer day, I can SSH into my desktop (which is hooked up to a home theater) and run a mpg123 to start my music without ever leaving the chair, or being forced to deal with the low-quality underpowered netbook speakers. Just SSH into the machine and run mpg123 as if you were sitting at the keyboard, as in
ssh
username@
my-remote-machine-address mpg123-Z
--@
<
myplaylistfile ConclusionJoshua Price
Josh Price is a senior MakeTechEasier writer and owner of Rain Dog Software
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.
You're reading How To Play Mp3S From The Linux Command Line
Pem: Manage Your Personal Expenses From The Command Line
While expense management is a critical task, both for businesses and individuals, it generally requires you to use a GUI-based software. If you’re a command line geek who is looking for a CLI-based alternative, you should give pem a try. In this article, we will discuss the command line tool, along with the features it provides.
Note: all the examples discussed in this article are tested on Ubuntu 14.04.
Pem InstallationThe easiest way (that I found) to install the tool is by downloading the package from its official website, building it from source, and then installing it. Here are the steps:
tar
-xzvf
pem-0.7.9.tar.gz
cd
pem-0.7.9 .
/
configure
make
sudo
make
install
An important point worth mentioning here is that instead of using wget (the first step), you can head to the GNU website to download the latest version of the tool.
UsageBasic usage of the pem command is very easy – you just have to pass an expense note or description, followed by the expense amount. Here is an example:
The command above stores the description “Weekend Lunch” as well as the amount 700 in a file, which is named after the current month, and placed in the “.pem” folder under your HOME directory.
Note: if the expense description consists only of a single word, it is not mandatory to put it in double quotes, but if there are multiple words, it should always be put in double quotes.
Here is what the file contains:
The format of the output is [code],[tag],[income],[expense]
Use customized file name using -f optionInstead of using the standard file name and location (as specified in the previous example), you can also specify some other file using the -f option. Here is an example:
The command above will store the expense amount as well as details in the exp.txt file located on the Desktop.
Record an earning using the -e optionLike any other expense manager, the pem tool also lets you record your earnings, which can be done using the -e option. Here is an example:
Categorise your expenses or earnings using the -c optionYou can attach tags or categories to your expenses or earnings using the -c option. For example:
The command shown in the screenshot above lists “Trip to Vegas” under the ‘travel fun’ category.
See a daily report using -s optionYou can ask the pem command to display a daily report using the -s option. Here is an example:
You can also pass a number along with the above command to see a daily report with total after that many days. For example, pem -s 3 would display a daily report with a total after 3 days.
Similarly, you can use the -m option to display a monthly report.
Display category/tag-wise report using -C optionSometimes it is required to view results based on a particular category or tag. You can do just that using the pem command’s -C option. Here is an example:
So you can see that the command shown in the screenshot above displays results related to the ‘travel’ category.
For more options, go through the man page.
ConclusionHimanshu Arora
Himanshu Arora is a freelance technical writer by profession but a software programmer and Linux researcher at heart. He covers software tutorials, reviews, tips/tricks, and more. Some of his articles have been featured on IBM developerworks, ComputerWorld, and in Linux Journal.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.
How To Convert Xls File To Csv In Command Line
catdoc (in C)The first command line tool we are going to talk about is catdoc. The tool is written in C by V.B. Vagner.
1.1 How to install it:gunzip
chúng tôitar
xvf chúng tôi we have a catdoc-0.94.2 directory. Go inside this directory and run the following commands to install it: ./
configuremake
make
install
The installation is an easy process and you should not face any problem here.
1.2 How to use it:There are several option to run the command. I’ll tell the options that works best for the Microsoft Excel conversion:
xls2csv--help
1.3 Pros and Cons:Pros: Straight forward installation
Cons: No selective conversion in multiple sheet scenario, it coverts all the sheets present in the xls file (one workaround would be to explicitly specify a footer in each sheet and then use option -b in the command), problems with few European characters, problem with date fields (the date fields are messed up big times), messes with quotes.
xls2csv (in Perl)The second tool we are going to talk about is a Perl script xls2csv written by Ken Prows in Perl.
2.1 How to install it:Download the script here. Gunzip and tar it like we did in previous section and go the extracted directory and use the following commands to install it:
perl
chúng tôimake
make
test
make
install
Remember this Perl script uses a number of other Perl modules:
2.2 How to use it:The following command can be used to convert Microsoft excel to csv:
xls2csv-x
"Path_of_Your_XLS_File"
-b
cp1252-w
WorkSheetName-c
"Path_of_Your_CSV_File"
-a
8859
-1
Option x and c (means xls and csv) are used to specify the input and output files where as b and a (means before and after) are used to specify the respective character encoding. We have use the same character encoding as in previous tool.
2.3 Pros and cons:Pros: Good with western European character conversion and date fields, supports selective multiple sheet conversion,
Cons: Several Perl modules need to be installed, first cell should not be empty (otherwise it skips the whole row), messes with quotes
There are couple of other ways as well. Some scripts in Python and Java are also available to use but they are not as good as these two discussed here. I hope the article solves your problem. Question and suggestions are always welcomed. Cheers 🙂
Abhishek Prakash
Abhishek is a Linux lover and Opens Source enthusiast. He takes a keen interest in day-to-day computer life and wishes to share his experience with others to make their computer experience better and easier. He is the owner of increasingly popular tech blog Computer And You and Open Source blog It's FOSS.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.
Awk Command In Linux With Examples
If you’re working with Linux, then you may have come across AWK command. AWK is a powerful text processing tool that is used for a variety of tasks such as filtering, manipulating and transforming data. In this article, we’ll explore AWK command in detail, including its syntax, functions, and examples of its use.
What is AWK Command in Linux?AWK is a programming language and tool that is used for text processing and data manipulation. It is typically used for extracting and manipulating data from text files, but it can also be used for more complex tasks such as generating reports, analyzing data and more. AWK is available on almost all Unix-based systems and is often used in conjunction with other command-line tools such as sed and grep.
AWK Command SyntaxThe AWK command has a simple syntax that consists of a series of patterns and actions. Patterns are used to match specific lines of input, while actions are used to specify what should be done with those lines. Here is an example of basic syntax of AWK command −
awk 'pattern { action }' input_fileThe pattern is enclosed in single quotes and specifies which lines of input file should be processed. action is enclosed in curly braces and specifies what should be done with those lines. Multiple patterns and actions can be combined to create more complex scripts.
AWK Command FunctionsAWK has a variety of built-in functions that can be used to manipulate and process data. Here are some of most commonly used functions −
print − This function is used to print text to console or a file.
printf − This function is used to format text and print it to console or a file.
length − This function is used to determine length of a string.
substr − This function is used to extract a substring from a string.
split − This function is used to split a string into an array based on a specified delimiter.
getline − This function is used to read next line of input.
AWK Command ExamplesNow that we understand basic syntax and functions of AWK command, let’s look at some examples of how it can be used.
Example 1: Print Contents of a FileThe simplest use of AWK command is to print contents of a file to console. Here’s how to do it −
awk '{ print }' input_fileThis script will match every line in input file and print it to console.
Example 2: Print Specific Columns of a FileOne of most common uses of AWK is to extract specific columns from a file. Here’s how to extract first and third columns of a file −
awk '{ print $1, $3 }' input_fileThis script will match every line in input file and print first and third columns to console.
Example 3: Filter Lines Based on a ConditionAWK can also be used to filter lines based on a condition. Here’s how to print all lines in a file that contain word “error” −
awk '/error/ { print }' input_fileThis script will match every line in input file that contains word “error” and print it to console.
Example 4: Sum Values in a ColumnAWK can also be used to perform mathematical operations on data. Here’s how to sum values in second column of a file −
awk '{ sum += $2 } END { print sum }' input_fileThis script will add up all values in second column of input file and print total to console.
Example 5: Extract Substring from a ColumnAnother common task is to extract a substring from a column in a file. Here’s how to extract first three characters from first column of a file −
awk '{ print substr($1, 1, 3) }' input_fileThis script will extract first three characters from first column of input file and print them to console.
Example 6: Join Two Files Based on a Common ColumnAWK can also be used to join two files based on a common column. Here’s how to join two files based on value of first column −
awk 'NR==FNR{a[$1]=$2;next}{ print $0, a[$1] }' file1 file2This script will read first file into memory and create an array with values in second column. It will then read second file and print each line, followed by corresponding value from first file.
Example 7: Extract First Column of a FileTo extract first column of a file using AWK command, use following syntax −
$ awk '{ print $1 }' filenameHere, $1 refers to first column of input file. print command is used to display output.
Example 8: Calculate Average of a ColumnTo calculate average of a column using AWK command, use following syntax −
$ awk '{ sum += $1 } END { print sum / NR }' filenameHere, sum is a variable that stores sum of values in first column. NR is a built-in variable that stores number of records (lines) processed by AWK command. END pattern matches end of input file.
Example 9: Replace a String in a FileTo replace a string in a file using AWK command, use following syntax −
$ awk '{ gsub("oldstring", "newstring") } 1' filenameHere, gsub is a function that replaces all occurrences of oldstring with newstring. 1 pattern matches all lines of input file.
Example 10: Display Last Field of a FileTo display last field of a file using AWK command, use following syntax −
$ awk '{ print $NF }' filenameHere, $NF refers to last field of input file. print command is used to display output.
Example 11: Using Regular ExpressionsRegular expressions are a powerful feature of AWK command that allows users to search for patterns in data. Here’s an example that demonstrates use of regular expressions −
$ awk '/pattern/ { print }' filenameHere, /pattern/ is a regular expression that matches any line that contains pattern.
Example 12: Using VariablesVariables can be used in AWK command to store values that can be used in actions. Here’s an example that demonstrates use of variables −
$ awk '{ total += $1 } END { print "Total: ", total }' filenameHere, variable total is used to store sum of values in first column.
Example 13: Using Built-in VariablesThe AWK command has several built-in variables that can be used to perform various tasks. Here are some examples −
FS − field separator variable is used to specify delimiter used to separate fields in input file. By default, it is set to whitespace.
RS − record separator variable is used to specify delimiter used to separate records in input file. By default, it is set to a newline character.
OFS − output field separator variable is used to specify delimiter used to separate fields in output. By default, it is set to whitespace.
ORS − output record separator variable is used to specify delimiter used to separate records in output. By default, it is set to a newline character.
Example 14: Using Control StatementsControl statements such as if-else and while loops can be used in AWK command to perform conditional operations. Here’s an example that demonstrates use of if-else statements −
Here, if value in first column is greater than 50, output will be “Pass,” otherwise it will be “Fail.”
Example 15: Using FunctionsFunctions can be defined and used in AWK command to perform complex operations. Here’s an example that demonstrates use of functions −
$ awk 'function square(x) { return x*x } { print square($1) }' filenameHere, function square is defined and used to calculate square of value in first column.
ConclusionThe AWK command is a powerful tool for text processing and data manipulation in Linux. With its simple syntax, built-in functions, and ability to perform complex tasks, AWK is an essential tool for any Linux user. By using examples in this article, you should be able to get started with AWK and begin to unlock its full potential.
How To Play Catan With Your Friends Straight From The Browser
How to Play Catan with Your Friends straight from the Browser Rest assured that Catan Universe is the best option to consider
366
Share
X
Settlers of Catan was originally a table-top board game invented by Klaus Teuber in 1995.
You don’t need a board,
dice
, or pieces to
play
Catan
. You can simply
play
the
game
online
.
There are currently only two ways in which you can
play
Catan
online
. Learn about them in this guide.
True gamers use the best gaming browser: Opera GX
Opera GX is a special version of the famous Opera browser that is built specifically to fulfill gamer’s needs. Packed with unique features, Opera GX will help you get the most out of gaming and browsing everyday:
CPU, RAM and Network limiter with hot tab killer
Integrated with Twitch, Discord, Instagram, Twitter and Messengers directly
Built-in sound controls and custom music
Custom color themes by Razer Chroma and force dark pages
Free VPN and Ad blocker
Download Opera GX
However, before you continue with the rest of this article, you need to ensure that you’re optimized to run online games.
Is there a way to play Catan online with friends?How can I play Catan online with friends?
The best way to play the modern game of Catan online is through Catan Universe. It seems to have the best graphics and features.
Furthermore, browser players can compete against mobile players. Catan Universe allows up to six players.
The base multiplayer version of the game is completely free. You can create your own avatar and change the theme of the board. All you have to do is sign-up and register an account.
However, Catan Universe does allow you to test the game without registering an account. Its features a bit more limited if you decide to play account-free.
Unfortunately, like most computer games, it does come with a set of system requirements. Make sure that your PC meets them before trying to play the game.
Moreover, Opera GX lets you monitor your RAM and CPU in order to avoid performance problems. The browser has quick access to social apps for gamers like Discord and Twitch.
Opera GX
Get the best out of the Catan Universe with this fast and modern browser!
Free Visit website
Catan Universe system requirements
Operating System: Any 64 Bit operating system (Windows 7/8/8.1/10, Mac OS 10.6+, Linux)
Processor: Quad-Core CPU or better
RAM: 4GB
Graphics Card: Open GL 3.1+ Compliant
Once you’re sure that your system meets these requirements you can register an account with Catan Universe.
Set up an account with Catan UniverseOnce your account is successfully activated, Catan Universe will give you a virtual tour and tutorial to help you familiarize yourself with the game.
All your friends need to create accounts before you can play with them. If you find that you don’t like Catan Universe very much, there is an alternative.
Alternative online Catan gameCatan Universe is the best way to play Catan online, however, there is another outstanding option. chúng tôi is a less graphically taxing alternative to Catan Universe. It is by no means better than Catan in terms of design or execution but some players appreciate its simplicity.
Up to four players can play at a time and chat with each other. If your friends are too busy to play with you, you can play against bots or fish for people to play against in the lobby.
In addition to this and most importantly, it’s completely free. It has a thriving community behind it. All of these points make it one of the best online games.
In this guide, we demonstrated how you can play the Catan game online. Games like Catan Universe can be resource-heavy at times, so make sure you play it using Opera GX for the best experience.
Still experiencing issues?
Was this page helpful?
x
Start a conversation
How To Play Sepak Takraw?
How to Play Sepak Takraw?
The rules and regulations of Sepak takraw are very much similar to that of volleyball. The rules vary based on event levels and organizations. The game is played between two teams which are known as Regu. There are two types of sepak takraw events −
Regu − Three players on each side.
Doubles Regu − Each team has two players.
In Regu, each team has three players including two substitute players. On the court, the team comprises of a Striker, a Server, and a Feeder. Each player possesses different set of skills and tactics.
ServerThe main job of the server or Tekong is to serve the ball. Prior to the match, each team must register with minimum 9 players or maximum 12 players. The server usually hits the ball with high speed across the net with great speed making it difficult for the opponent players to defend.
StrikerThe striker or killer is responsible for executing the volleys in to opponent side with high speed. When the striker does not possess the ball, he usually tries to block high kicks from the opponent side.
FeederThe third type of player is the Feeder, who has the maximum control over the ball during the match. He is the most agile and responsive player in the team. The main job of the feeder is to set the ball in a suitable way for the striker to kick hard past the net. He can also hit the ball across the net. The server usually stands in the back whereas the striker and feeder take the front left side and front right side.
How to Play?The very basic rules of the game are as follows −
The game starts with a serve. The team that has to serve first is decided by tossing a coin. The winner of the toss can either choose to serve or choose to defend. The side that serves first starts the set.
During the serve, the server must have one of his legs inside the service circle, whereas the other players must stay in their respective quarter circles.
Either the feeder or the striker first tosses the ball to the server who then kicks the ball across the net to the opponent side with no foot in the service circle.
Tossing the ball to the server must be done only after the referee announces the score. If the throw takes place before the score call, then the ball is again re-thrown and a warning is given to the team.
A serve is called valid if it passes over the net to the opponent side inside the boundary before the boundary line of the opponent team. Whether it touches the net or not doesn’t matter. Once the serve is done, the players are free to move in to any part of their respective court.
In order to respond the serve, the defending team tries to again pass the ball across the net to the opponent side within three touches of the ball.
Usually the feeder and the server move around the court to defend the serve of the opposition and set the ball for the striker to strike in two touches.
The side that wins the first set has the option of choosing the service.
The game continues till one of the team makes a fault. Once a fault is done by a team, the opponent team gets a point.
When the ball is not in play, each team is entitled to a tactical timeout of one minute during the game. There are no automatic timeouts.
During the timeout, maximum five players are allowed on the base line in case of Regu matches.
In case a player gets injured and needs immediate treatment, the referee can suspend the game temporarily for 5 minutes. If after the 5 minutes, the player is still unable to play, he can be substituted with another player.
ScoringAn official Regu or Doubles Regu match usually comprises of three sets of game with each set having 21 points. In case of a team event, three back to back matches are played using different players for each Regu.
The winner is determined by best of three sets. Once a set is over, the teams change their side and the team which lost the previous set serves first.
If both teams are at 20-20 at the end of the game, the game is extended up to 25 points and the first team to be ahead by 2 points wins the set. When a team wins two sets, the match is won. If any of the team doesn’t win two back to back matches, the third match which is also called the tie-breaker match, only has the target of 15 points.
Before a tie-breaker match takes place, again a coin is tossed by the referee and the winner of the toss chooses to either serve or defend. After 7 points during the tie-breaker match, the teams change sides. In case of a tie- breaker match, if both teams are at 14-14, then the match is extended up to 17 points and the first team to be ahead by 2 points wins the match.
SubstitutionDuring the matches, teams can make a substitution from the two substitute players. The same player cannot be repeated for any team competition involving more than one team. Out of the registered players, different players are chosen for different Regus. A player can be substituted at any time on request made by the team when the ball is not on play.
A team can consider a maximum of two substitute players but during a match, only one substitution is allowed. A player who has been sent off by the referee can be substituted, if and only if no substitution has been done till that moment. A team with less than three players is not allowed to play in the game and is considered as the looser side.
Advertisements
Update the detailed information about How To Play Mp3S From The Linux Command Line on the Benhvienthammyvienaau.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!