Just installed Ubuntu Desktop 16.04 on a HP Pro 400 G2 . Everything went good, I think I properly installed the video card driver which is an integrated intel hd graphic card driver. I rebooted, I had no errors but still the graphics are blurry or pixelated. Any thoughts on this?
Adrian George's questions
I am not a guru of linux and advanced configuration and this might be a silly question but how am I going to configure postfix (smtp) to use port 201 in same time with 25, on an Ubuntu 12.04 server.
I managed to do something in /etc/postfix/master.cf , at the end of this file I added:
201 inet n - - - - smtpd
It seems that I can connect now but in the Mail Queue I find the following error:
connect to alt2.gmail-smtp-in.l.google.com[74.125.68.27]:25: Connection refused
And it's not only for gmail addresses, it doesn't work for any.
If I am going to configure the email client with port 25 at smtp. I don't have this problem.
Seems that I am missing something.
Any help would be really appreciated.
I have a big folder with hundreds of thousands of files. Total size is 10GB
The idea is that I want to archive this folder so I can transfer it to another server faster than file by file.
I tried with tar cfj archive.tar.bz2 dir-to-be-archived/
but it still seems to be slow.
I don't care about the final size because the network connection works up to 100mb/s in transfer.
I heard something about lzop
but I didn't understood exactly how to use it.
So is there anyway to create an archive really fast, like in 10-15 minutes?
I unpacked the Arduino archive.
I have jdk, jre installed properly.
When I am trying to launch Arduino 1.6.1 IDE I get the following error and I have no idea where to start from to solve it.
Any thoughts?
I am trying to set all folders and subfolders (directories) to 755 and all files that are contained by folders and subfolders to 644.
I don't know how can I do this from 1-2 commands. Is this even possible?
I am trying to display all services and their versions that runs on a host using ports from 1 to 1023, in this way:
ssh, OpenSSH 5.9p1 Debian 5ubuntu1 (protocol 2.0)
smtp, Postfix smtpd
http, Apache httpd 2.2.22 ((Ubuntu))
rpcbind
imap, Courier Imapd (released 2011)
ssl/imap, Courier Imapd (released 2011)
I know how to display them but not in the format above:
nmap -p 1-1023 -sV host
LATER EDIT:
I managed to display only the services without any extra unuseful text:
nmap -p 1-1023 -sV host | head -n -5 | tail -n +7
Which outputs:
8/tcp open http BitTornado tracker T-0.3.18
21/tcp open ftp vsftpd 2.3.5
22/tcp open ssh OpenSSH 5.9p1 Debian 5ubuntu1 (protocol 2.0)
23/tcp open telnet Linux telnetd
25/tcp open smtp Postfix smtpd
80/tcp open http Apache httpd 2.2.22 ((Ubuntu))
111/tcp open rpcbind
143/tcp open imap Courier Imapd (released 2011)
158/tcp open ssh OpenSSH 5.9p1 Debian 5ubuntu1.1 (protocol 2.0)
165/tcp open ssh OpenSSH 5.9p1 Debian 5ubuntu1.1 (protocol 2.0)
177/tcp open ftp vsftpd 2.3.5
210/tcp open ssh OpenSSH 5.9p1 Debian 5ubuntu1.1 (protocol 2.0)
993/tcp open ssl/imaps?
Now I am really curious how can I get rid of the first two columns.
I want to make a shell script that downloads all files that area named [0-9][0-9].png;
e.g: 00.png 01.png 33.png 91.png etc
files = ???????
for file in files
do
curl ftp://server/${file}
done
What should I put at files = ???
I have ProFTPd service installed on my server which runs Ubuntu Linux 14.04 . I don't know why ProFTPd closes by itself. I have enough RAM and CPU and I really don't know why this happens. I also checked ProFTPd config file I still don't figure it out.
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes, reload proftpd after modifications, if
# it runs in daemon mode. It is not required in inetd/xinetd mode.
#
# Includes DSO modules
Include /etc/proftpd/modules.conf
# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6 on
# If set on you can experience a longer connection delay in many cases.
IdentLookups off
ServerName "Debian"
ServerType standalone
DeferWelcome off
MultilineRFC2228 on
DefaultServer on
ShowSymlinks on
TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200
DisplayLogin welcome.msg
DisplayChdir .message true
ListOptions "-l"
DenyFilter \*.*/
# Use this to jail all users in their homes
#DefaultRoot ~
# RequireValidShell off
# Port 21 is the standard FTP port.
Port 21
# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
# PassivePorts 49152 65534
# If your host was NATted, this option is useful in order to
# allow passive tranfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
# MasqueradeAddress 1.2.3.4
# This is useful for masquerading address with dynamic IPs:
# refresh any configured MasqueradeAddress directives every 8 hours
<IfModule mod_dynmasq.c>
# DynMasqRefresh 28800
</IfModule>
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30
# Set the user and group that the server normally runs at.
User proftpd
Group nogroup
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd off
# This is required to use both PAM-based authentication and local passwords
# AuthOrder mod_auth_pam.c* mod_auth_unix.c
# Be warned: use of this directive impacts CPU average load!
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
#
# UseSendFile off
TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log
# Logging onto /var/log/lastlog is enabled but set to off by default
#UseLastlog on
# In order to keep log file dates consistent after chroot, use timezone info
# from /etc/localtime. If this is not set, and proftpd is configured to
# chroot (e.g. DefaultRoot or <Anonymous>), it will use the non-daylight
# savings timezone regardless of whether DST is in effect.
#SetEnv TZ :/etc/localtime
<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>
<IfModule mod_ratio.c>
Ratios off
</IfModule>
# Delay engine reduces impact of the so-called Timing Attack described in
# http://www.securityfocus.com/bid/11430/discuss
# It is on by default.
<IfModule mod_delay.c>
DelayEngine on
</IfModule>
<IfModule mod_ctrls.c>
ControlsEngine off
ControlsMaxClients 2
ControlsLog /var/log/proftpd/controls.log
ControlsInterval 5
ControlsSocket /var/run/proftpd/proftpd.sock
</IfModule>
<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>
#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf
#
# This is used for FTPS connections
#
#Include /etc/proftpd/tls.conf
#
# Useful to keep VirtualHost/VirtualRoot directives separated
#
#Include /etc/proftpd/virtuals.conf
# A basic anonymous configuration, no upload directories.
# <Anonymous ~ftp>
# User ftp
# Group nogroup
# # We want clients to be able to login with "anonymous" as well as "ftp"
# UserAlias anonymous ftp
# # Cosmetic changes, all files belongs to ftp user
# DirFakeUser on ftp
# DirFakeGroup on ftp
#
# RequireValidShell off
#
# # Limit the maximum number of anonymous logins
# MaxClients 10
#
# # We want 'welcome.msg' displayed at login, and '.message' displayed
# # in each newly chdired directory.
# DisplayLogin welcome.msg
# DisplayChdir .message
#
# # Limit WRITE everywhere in the anonymous chroot
# <Directory *>
# <Limit WRITE>
# DenyAll
# </Limit>
# </Directory>
#
# # Uncomment this if you're brave.
# # <Directory incoming>
# # # Umask 022 is a good standard umask to prevent new files and dirs
# # # (second parm) from being group and world writable.
# # Umask 022 022
# # <Limit READ WRITE>
# # DenyAll
# # </Limit>
# # <Limit STOR>
# # AllowAll
# # </Limit>
# # </Directory>
#
# </Anonymous>
# Include other custom configuration files
Include /etc/proftpd/conf.d/
<Global>
DefaultRoot ~
AllowOverwrite on
</Global>
Any ideas about how can I prevent it shutting down by itself?
Thank you.
How can I create a shell script which receives a vector argument like
./script.sh google.com,yahoo.com
and display ip for each domain
like google.com 100.23.123.13
EDIT:
#!/bin/bash
while [ "$1" ];
do
host $1 | grep address | head -1
done
How can I copy all files which starts with "b" or "B" from /bin to a specific folder?
I tried cp /bin* b
, but I didn't succeed.
I am trying to find all files which size is higher than $1 (parameter) and zip them using a shell script.
#!/bin/bash
find . -type f -size +$1c = $files
tar -xf $files
But I think this isn't the right solution.
I am trying to display all files which contain a specific word on more then three lines.
i.e. file:
Andrew is so nice,
and Andrew want some ice,
but Andrew doesn't roll the dice.
So this file contains Andrew on more than three lines, so it will be displayed.
I used grep -or '\' but it list all files which contain "word" on at least 1 line.
How can I display a message like:
eth1 interface has been enabled
each time when eth1 is enabled?
Let me know if my question make sense.
I want to display the time elapsed since last system boot using uptime
, but I don't want it to display all that info. I just want to know how many hours passed since last system boot (i.e. : 18:17:59)
I am trying to display only the current time using "date", not all that information Day, Month, Year etc.. , only the current time.
i.e.:
13:45 or 1:45pm
Any ideas?
I am trying to capitalize each first letter of the first word in each sentence from a txt file called input.txt and I want this input file to be a argument of the shell script
./script.sh input.txt
sample input file:
i am Andrew. you are Jhon. here we are, forever.
result file:
I am Andrew. You are Jhon. Here we are, forever.
A special case. What if our text is (related to @RaduRadeanu answer)
i am andrew. you
are jhon. here we are
forever
the result would be:
I am andrew. You
Are jhon. Here we are
Forever.
So it convert to uppercase each first word of each sentence and also each first word of new line. How do we skip over uppercase first word of new line?
So the correct result must be:
I am andrew. You
are jhon. Here we are
forever.
What if the sentence closes in "?" or "!" ???
I know this is a silly question, but since I am trying so hard to learn linux by myself, I need some help from you fellows.
I found this task on the internet and I am trying to solve it but I don't understand exactly how can I use makefiles in linux and how can I create them.
Let's suppose my print working directory is /home/george/Documents
I want to create a makefile which does the following:
- Displays a message as follows "hello work, today is Sun". Sun comes from Sunday. So I must use
date
command in this make file to display just first three letters. compress
/etc/hosts
in/tmp
usinggzip
(probably here should be something likegzip -c SOURCE DESTINATION # ??
Cheers
I tried the following code, but I'm missing something somewhere. I want to create a symbolic link to all *.conf files from /etc/ in /root/links
#!/bin/bash
for conf in /etc/
do
ln -s "$conf" "/root/links/$conf"
done
I want to search for all .conf
files in /etc/
.
I tried grep -r *.conf /etc
, but the result isn't right.
What am I doing wrong?
Which would be the right chmod
value for a directory where everyone can write on it, but only the owner of the content can delete it?
I thought chmod 1755 path_to_directory
would be the right one, but it isn't.
I am beginner on linux, i tried finding this on google, but i wasn't successful.