When copying a shell script from Windows to Linux and execute it:
/bin/bash^M: bad interpreter: No such file or directory
Solution: Remove \r:
sed -i ‘s/\r//’ scrip_file.sh
When copying a shell script from Windows to Linux and execute it:
/bin/bash^M: bad interpreter: No such file or directory
Solution: Remove \r:
sed -i ‘s/\r//’ scrip_file.sh
#!/bin/sh
echo ‘Check Gemfile…’;
if diff path/file1 path/file2 >/dev/null ; then
echo ‘Same’;
else
echo ‘Different’;
fi
Use –strip 1
tar -xvf ZendFramework-1.7.2.tar.gz --strip 1
Use trickle
sudo yum install trickle
trickle -d <kB/s for download> -u <kB/s for upload> bash
1. Clean up yum db:
sudo rm -f /var/lib/rpm/__db*
sudo rpmdb -vv –rebuilddb
2. If the problem persists, check your proxy config:
sudo grep ‘proxy’ /etc/yum.conf
Note that the proxy config should be present in yum.conf, even if you already set a value for http_proxy
First, get the list of packages to be removed:
rpm -qa –qf=”%{n}-%{v}-%{r}.%{arch}n” ‘mongo*’ | sort
Then use yum remove
sudo yum remove <package names>
The old rule: Swap size should be twice of the RAM is only applicable in the old system when RAM is small (<1GB)
The new rule:
Swap = Equal RAM size (if RAM < 2GB)
Swap = 2GB size (if 2GB < RAM < 8GB)
Swap = 0.5 RAM size (if RAM > 8GB)
There is no benefit to put the swap size twice as RAM > 2GB since a system using up to mutiple GBs in swap memory should not be a good design for performance.