If you want to install *.rpm files under Debian you could use alien.
1 2 |
apt-get install alien alien -i package.rpm |
Everything about the GNU/Linux Bash.
This is an collection of problems and bugs I had with Backtrack 5 R2 (Linux based Distribution).
To download Backtrack look at http://www.backtrack-linux.org/downloads/
Ubuntu software centre and update manager
For more Software, I installed the ubuntu software centre with this command:
1 |
sudo apt-get install software-center |
then run a update:
1 |
sudo apt-get update && apt-get dist-upgrade |
now you could choose your software sources at:
System > Administration > Software Sources
If you want the Update manager, run this:
1 |
sudo apt-get install update-manager |
Or you could add the ubuntu repository to your system, just open the “/etc/apt/sources.list” file and generate a list from http://repogen.simplylinux.ch/generate.php, now you could add what you want.
NVIDIA or ATI/AMD driver
NVIDIA: http://www.nvidia.de/Download/indexsg.aspx?lang=de
just run it from your download folder.
ATI/AMD: http://support.amd.com/us/gpudownload/Pages/index.aspx
Code:
1 2 3 |
sudo sh amd-driver.run --buildpkg Ubuntu/lucid sudo dpkg -i fglrx*.deb sudo aticonfig --initial -f |
After a reboot you could check your driver status with:
1 |
fglrxinfo |
Network
If you need more features at your network just install what you need:
network-manager-openvpn – network management framework (OpenVPN plugin core)
network-manager-openvpn-gnome – Network Management framework (OpenVPN plugin GNOME GUI)
network-manager-pptp – network management framework (PPTP plugin)
network-manager-pptp-gnome – network management framework (PPTP plugin)
network-manager-vpnc – network management framework (VPNC plugin core)
network-manager-vpnc-gnome – network management framework (VPNC plugin GNOME GUI)
network-manager – network management framework daemon
network-manager-dev – network management framework (development files)
network-manager-gnome – network management framework (GNOME frontend)
1 2 3 4 5 6 7 8 9 |
sudo apt-get install network-manager-openvpn sudo apt-get install network-manager-openvpn-gnome sudo apt-get install network-manager-pptp sudo apt-get install network-manager-pptp-gnome sudo apt-get install network-manager-vpnc sudo apt-get install network-manager-vpnc-gnome sudo apt-get install network-manager sudo apt-get install network-manager-dev sudo apt-get install network-manager-gnome |
Add the Network icon to the panel:
1 2 3 4 |
echo auto lo > /etc/network/interfaces echo iface lo inet loopback >> /etc/network/interfaces service network-manager start nm-applet & |
network is blocked
To solved this run this:
1 |
sudo rfkill unblock all |
Disable bell in terminal
open the file “/etc/inputrc” and add this:
1 |
set bell-style none |
Mint backup
run this:
1 2 |
sudo add-apt-repository ppa:webupd8team/mintbackup && sudo apt-get update sudo apt-get install mintbackup |
BUG : wait for sound system to respond
System > Preferences > Startup Applications add this:
1 |
/usr/bin/pulseaudio |
BUG : Couldn’t execute command: xscreensaver-command -lock
run this command:
1 |
apt-get install xlockmore gconf-editor |
System > Preferences > Keyboard Shortcuts
Lock Screen disable.
Add new “Ctrl+Alt+L” with “xlock” ,apply done!
BUG : Chrome wont start as root
Menue>Internet>Chrome>Properties>Comand and add this:
1 |
/usr/bin/chromium-browser %U --user-data-dir www.google.at |
BUG : run a *.deb
1 |
sudo dpkg -i name.deb |
BUG : E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. Current value: 25165824. (man 5 apt.conf)
Solution A:
open “/etc/apt/apt.conf.d/70debconf” and add this:
1 |
APT::Cache-Limit "100000000"; |
then run this:
1 |
sudo apt-get clean && sudo apt-get update --fix-missing |
Solution B:
open “/etc/apt/apt.conf.d/90user” and add this:
1 |
APT::Cache-Limit "100000000"; |
BUG : GRUB2 error: out of disk
1 2 |
sudo mount /dev/sda1 /mnt sudo grub-install --root-directory=/mnt /dev/sda |
BUG : VLC is not supposed to be run as root. Sorry.
1 2 |
sudo apt-get install ghex ghex2 /usr/bin/vlc |
In line 7F8, replace “geteuid” with “getppid”.
This is an example how to rename files with regex.
At first we need to create some files:
1 2 |
`touch {1,2}OLD.txt`; `touch {1,2}TEST.txt`; |
Lets look what we got:
1 2 |
sh-4.2# ls 1OLD.txt 1TEST.txt 2OLD.txt 2TEST.txt |
now rename this files:
1 |
rename 's/OLD/NEW/' *.txt |
And we see the renamed files:
1 2 |
sh-4.2# ls 1NEW.txt 1TEST.txt 2NEW.txt 2TEST.txt |
If you want to print the current date in Perl use in-line shell like this:
1 |
print `date +%d-%m-%Y:%H:%M:%S`; |
In shell:
1 |
echo `date +%d-%m-%Y:%H:%M:%S` |
The output looks in both ways like this:
1 |
04-03-2015:18:06:38 |
Test String (10xX):
1 |
___XXXXX_____XXXXX_____ |
Test Cases Results must look like:
single char remove:
1 |
___XXXX_____XXXXX_____ |
single char replace:
1 |
___0XXXX_____XXXXX_____ |
string/multi char remove:
1 |
_____________ |
string/multi char replace:
1 |
___00000_____00000_____ |
Times:
run the test string from file 100000 times.
single char remove | single char replace | multi char remove | multi char replace | string remove | string replace | |
sed | 5.658s | 5.774s | 3.449s | 5.929s | 3.476s | 5.724s |
perl regex | 5.604s | 5.918s | 3.428s | 6.027s | 3.482s | 5.870s |
awk gsub | 3.469s | 5.892s | 3.339s | 5.942s | ||
tr bash | 5.972s | 5.897s | ||||
perl tr | 5.996s | 5.837s |
For bash its the easiest way to use sed because its simpler to use perl and it could do the most things or if you do simple things you could use tr.In perl you could see this benchmark.
SED 4.2.2
single char remove:
1 |
time cat bench.txt | sed 's/X//' |
single char replace:
1 |
time cat bench.txt | sed 's/X/0/' |
multi char remove:
1 |
time cat bench.txt | sed 's/X//g' |
multi char replace:
1 |
time cat bench.txt | sed 's/X/0/g' |
string remove:
1 |
time cat bench.txt | sed 's/XXXXX//g' |
string replace:
1 |
time cat bench.txt | sed 's/XXXXX/00000/g' |
AWK 4.0.1
single replace with regex not possible.
multi char remove:
1 |
time cat bench.txt | awk '{gsub("X","",$1);print $1;}' |
multi char replace:
1 |
time cat bench.txt | awk '{gsub("X","0",$1);print $1;}' |
string remove:
1 |
time cat bench.txt | awk '{gsub("XXXXX","",$1);print $1;}' |
string replace:
1 |
time cat bench.txt | awk '{gsub("XXXXX","00000",$1);print $1;}' |
TR 8.21
single replace and remove not possible.
multi char replace:
1 |
time cat bench.txt | tr "X" "0" |
string replace:
1 |
time cat bench.txt | tr "XXXXX" "00000" |
PERL REGEX 5
single char remove:
1 |
time cat bench.txt | perl -lpe 's/X//' |
single char replace:
1 |
time cat bench.txt | perl -lpe 's/X/0/' |
multi char remove:
1 |
time cat bench.txt | perl -lpe 's/X//g' |
multi char replace:
1 |
time cat bench.txt | perl -lpe 's/X/0/g' |
string remove:
1 |
time cat bench.txt | perl -lpe 's/XXXXX//g' |
string replace:
1 |
time cat bench.txt | perl -lpe 's/XXXXX/00000/g' |
PERL TR 5
multi char replace:
1 |
time cat bench.txt | perl -lpe 's/X/0/g' |
string replace:
1 |
time cat bench.txt | perl -lpe 's/XXXXX/00000/g' |