Coloring the C-Shell Prompt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
set   black = "%{\033[0;30m%}"
set Bblack = "%{\033[B;30m%}"
set red = "%{\033[0;31m%}"
set Bred = "%{\033[1;31m%}"
set green = "%{\033[0;32m%}"
set Bgreen = "%{\033[1;32m%}"
set yellow = "%{\033[0;33m%}"
set Byellow = "%{\033[1;33m%}"
set blue = "%{\033[0;34m%}"
set Bblue = "%{\033[1;34m%}"
set purple = "%{\033[0;35m%}"
set Bpurple = "%{\033[1;35m%}"
set cyan = "%{\033[0;36m%}"
set Bcyan = "%{\033[1;36m%}"
set white = "%{\033[0;37m%}"
set Bwhite = "%{\033[1;37m%}"
set end = "%{\033[0m%}"

alias setprompt 'set prompt = "\n${cyan}%~\n${Bpurple}%n@%m${Bwhite}[`id -ng`]${end} "'
alias cd 'chdir \!* && setprompt'
setprompt

Disable Clipboard in NoMachine

Disabling clipboard (copy and paste) in NoMachine is possible by setting the appropriate key on the NoMachine server installation. It isn’t restricted to the product you are using. I.e you can set it also if you have installed the free version of NoMachine on the computer you are accessing.

By default users can copy and paste from locale to the session and vice-versa.

You can configure the server to limit such operations by setting proper values in the server configuration file (/usr/NX/etc/server.cfg on Linux) as explained below.

Forbid copy & paste operations

To forbid copy & paste partially or totally, uncomment and set a proper value for the EnableClipboard key. Possible settings are:

  1. EnableClipboard client Content copied on the user’s side can be pasted inside the session
  2. EnableClipboard server Content copied inside the session can be pasted on the user’s side
  3. EnableClipboard none No copy and paste operations are allowed
  4. EnableClipboard both Two-way copy and paste operations are allowed

Update GLIBC 2.17 in RHEL6

  1. Download RPMs
    https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/
  2. Install RPMs
    sudo rpm -Uvh glibc-2.17*.rpm
    You might encounter some error like “error: Failed dependencies:…”.
    To fix it just add this parameter --force --nodeps at the end of the rpm command.
    After finished up let’s check what versions of GLIBC we are having now.
    strings /lib64/libc.so.6 | grep GLIBC or sudo yum list | grep -i glibc

Read More

NIS Commands

sudo /usr/lib64/yp/ypinit -m # server

sudo service ypbind status # node
sudo service ypbind start # node
sudo service ypbind stop # node
sudo service ypbind restart # node
sudo service ypbind reload # node

Vim: Generate and Increment Numbers

Increment Numbers

  1. C-v to enter visual mode
  2. Move the cursor up/down to select columns
  3. g + C-a

Generate Numbers

1
2
3
:put=range(1,5) # Generate 1,2,3,4,5 by column
:put=range(10,2,-2) # Generate 10,8,6,4,2 by column
:put=range(line('.'),100) # Generate numbers from current line number to 100

This feature is supported only in Vim 8.0 or higher versions.

Synopsys Safety-Aware Solution for Automotive

  • Save effort with automated FMEA/FMEDA and native RTL-to-GDSII implementation of hardware safety mechanisms
  • Minimize human error with native FuSa design intent to describe safety mechanisms
  • Reduce documentation work with automated work products and supporting evidence
  • Reduce design time with automotive compliant IP, fast FuSa analysis, and earlier RTL
  • Improve QoR with native tools to reduce congestion and area impact due to hardware safety mechanisms
  • Optimize machine resources with faster native tools that use less memory

Approaches to Disable SSH

一、禁止用户登录

1、修改用户配置文件/etc/shadow
将第二栏设置为“*”,如下。那么该用户就无法登录。但是使用这种方式会导致该用户的密码丢失,也就是当你再次允许他登录的时候,你还得让他重新设置密码。(再次启用这个帐号的方法是把“*”去掉就可以了)
如:tom:*:14245:0:99999:7:::

为了使原密码不丢失,可以在原密码前面加一个特殊字符,比如”!”。需要再次启用这个用户的方法是删除此感叹号”!”。

2、使用命令usermod
这个方式简单又实用,而且没有(1)中的副作用。

1
2
usermod -L tom##Lock 帐号tom
usermod -U tom##Unlock 帐号tom

Read More