Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Fri Dec 02, 2022 1:02 pm


News News of Tutorials for general Unix

Site map of Tutorials for general Unix » Forum : Tutorials for general Unix

Tutorials applicable on more than one Unix/Linux OS and shell scripts: ssh / openssl / protocols.

 [ Total topics 29 Go to page 1, 2, 3

Message
 Post subject: bash: Redirecting standard error to a shell variable and standard output to a file
PostPosted: Mon Oct 31, 2011 6:54 am 
A little background from bashref:http://www.gnu.org/software/bash/manual/bashref.html
Quote:
3.2.4.3 Grouping Commands

Bash provides two ways to group a list of commands to be executed as a unit. When commands are grouped, redirections may be applied to the entire command list. For example, the output of all the commands in the list may be redirected to a single stream.

()
( list )

Placing a list of commands between parentheses causes a subshell environment to be created (see Command ...

Read more : bash: Redirecting standard error to a shell variable and standard output to a file | Views : 4889 | Replies : 0

Top
 Post subject: Fix shell terminal after cat-ing a binary or echoing some encrypted content
PostPosted: Thu Mar 03, 2011 5:58 am 
Ever had the putty/securecrt/terminal looking like this after cat-ing a binary or echoing encrypted content ?

Code:
[⎼⎺⎺├@├␤⎺⎼ ·]#
[⎼⎺⎺├@├␤⎺⎼ ·]#
[⎼⎺⎺├@├␤⎺⎼ ·]#
[⎼⎺⎺├@├␤⎺⎼ ·]# ␊␌␤⎺ '\17'
\17
[⎼⎺⎺├@├␤⎺⎼ ·]# ␊␌␤⎺ -␊ '\␊(0'


There are many solutions on the web, but not all work all the time. Here's one that worked everytime for me:
Code:
echo -e '\017'

Read more : Fix shell terminal after cat-ing a binary or echoing some encrypted content | Views : 1651 | Replies : 0

Top
 Post subject: Linux - Unable to login (and authentication succeeds) - File size limit exceeded
PostPosted: Fri Oct 08, 2010 10:22 am 
This is most probably because of the /var/log/wtmp file which, if it goes over ~4.5GB, getty processes will not be able to create virtual terminals and all sorts of login problems from here on (sshd, telnet and so on).

Read more : Linux - Unable to login (and authentication succeeds) - File size limit exceeded | Views : 3142 | Replies : 3

Top
 Post subject: Normalizing terminal prompt (or putty prompt) after catting a binary file
PostPosted: Wed Aug 04, 2010 3:44 am 
Some binaries or some command output (unexpected) can contain control sequence which can cause a terminal to interpret it as changing character set. That's why the prompt becomes unreadable and keystrokes abnormal (lines).

To fix this, there are few possible solutions:
Code:
$ echo -e '\017'

or
Code:
$ reset
(NOT REBOOT)
or
Code:
$ stty sane

Read more : Normalizing terminal prompt (or putty prompt) after catting a binary file | Views : 2510 | Replies : 2

Top
 Post subject: Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server..
PostPosted: Thu Jul 22, 2010 2:30 pm 
Quote:
Syntax error on line 428 of /opt/apache-2.2.15_9/etc/apache22/httpd.conf:
Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server configuration


I started compiling apache from scratch (I removed almost all the modules). The error above was expected when installing php module.

Fix is to use apche APXS utility to install modules without recompiling apache:

Code:
# /opt/apache-2.2.15_9/sbin/apxs -c -i mod_mime.c


Caution: Use apxs from the version of Apache you want the module ...

Read more : Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server.. | Views : 5338 | Replies : 0

Top
 Post subject: Converting ^M characters to Unix new line
PostPosted: Sun Jul 18, 2010 11:20 am 
Needed this when working with html/xml files that contain ^M characters and in VI they show up quite ugly.

Code:
$ tr '\015' '\n' < file_in > file_out


Be sure to make backups first.

Read more : Converting ^M characters to Unix new line | Views : 2102 | Replies : 0

Top
 Post subject: Using Rrdtool and NUT to generate graphics about UPS battery charge, runtime and ups load.
PostPosted: Sun Jun 06, 2010 9:20 am 
The purpose of this post is to show how to use Rrdtool and NUT (Network Ups Tools) command line tools to generate graphics for the last 72 hours (give or take) on battery charge, it's runtime and UPS load.

As you know, Rrdtool is based on a database model. The database is used to generate the graphic.

To create the rrdtool database:

# /usr/bin/rrdtool create /var/lib/rrd/ups.rrd -s 60 \
DS:upsBat:GAUGE:600:0:U \
DS:upsLoad:GAUGE:600:0:U \
DS:upsBatRun:GAUGE:600:0:U ...

Read more : Using Rrdtool and NUT to generate graphics about UPS battery charge, runtime and ups load. | Views : 2905 | Replies : 1

Top
 Post subject: Using curl to get the HTTP response from an HTTP server
PostPosted: Sun Jun 06, 2010 9:05 am 
Using curl to get the HTTP response from an HTTP server.

Syntax: curl --head http://www.site.name

Quote:
curl(1) Curl Manual curl(1)

NAME
curl - transfer a URL

SYNOPSIS
curl

DESCRIPTION
curl is a tool to transfer data from or to a server, using one of the
supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT,
TELNET, LDAP or FILE). The command is designed to work without user ...

Read more : Using curl to get the HTTP response from an HTTP server | Views : 5516 | Replies : 3

Top
 Post subject: FIX: manconv: can't set the locale; make sure $LC_* and $LANG are correct
PostPosted: Thu May 20, 2010 12:43 pm 
The following error message:
Code:
manconv: can't set the locale; make sure $LC_* and $LANG are correct

can be fixed by upgrading the man-db package to version 2.5.3-1 or higher. On Debian (when writing this article) this package is available on SID repository or via sources from oficial website.

Read more : FIX: manconv: can't set the locale; make sure $LC_* and $LANG are correct | Views : 1938 | Replies : 0

Top
 Post subject: PERL can't set the locale; make sure $LC_* and $LANG are correct
PostPosted: Thu May 20, 2010 12:40 pm 
If you wish to fix the following errors (on debian google for other distributions)
Code:
can't set the locale; make sure $LC_* and $LANG are correct

or
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or ...

Read more : PERL can't set the locale; make sure $LC_* and $LANG are correct | Views : 3534 | Replies : 0

Top
 [ Total topics 29 Go to page 1, 2, 3


Last 10 active topics


Memory, Storage, Backup and Filesystems

No new posts FreeBSD: List disk drives and re-scan after adding hot-add disk (in virtual environments)
View the latest post

Routing and dynamic routing protocols

No new posts JUNOS BGP: How to drain a BGP peering router gracefully without bgp session reset
View the latest post

TP-Link JetStream Switching

No new posts TP-Link TL-SG3210 How to configure ARP Inspection, DHCP Snooping and ARP Scanning
View the latest post
No new posts TP-Link JetStream SG3210 V2.0 CLI, User Guide downloads
View the latest post

Apache, Nginx, Lighttpd and other web server software

No new posts NGINX: 413 Request Entity Too Large
View the latest post

System administration

No new posts MAC OS X: read image/jpeg EXIF information on command line
View the latest post

Shell Scripting and Programming

No new posts Shell scripting
View the latest post
No new posts AWK: How to replace a newline with actual \n
View the latest post
No new posts How to use $variable in conditional sentences?
View the latest post

Virtualization

No new posts SSH Login to Vmware ESXi with ssh keys
View the latest post

Login

Username:   Password:   Log me on automatically each visit  

Statistics

Statistics

Total posts 617 | Total topics 987 | Total members 1192



cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO