Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

2026-06-12

Scanner

 sudo apt update

sudo apt install simple-scan sane sane-utils 

(sudo apt install xsane)

2011-04-13

Linux

sudo su -
stty -F /dev/ttyUSB0 9600 cs8 -cstopb -parenb -icanon min 1 time 1
while true; do
        cat -v < /dev/ttyUSB0
done


В свежепроинсталлированой Fedora Linux не стартует сеть:

system-config-network-tui
system-config-firewall

1) dhclient eth0
2) chkconfig --list networking
chkconfig --list networking on
3)/etc/sysconfig/network-scripts/ifcfg-eth0:
ONBOOT=yes

virtualbox issue under Fedora 12:
sudo rmmod kvm-intel


Bluetooth:
sdptool browse local
sdptool add --channel=22 SP
sudo rfcomm listen /dev/rfcomm0 22  
cat /dev/rfcomm0
echo 'asdf' > /dev/rfcomm0 
echo -en '\xF4\x57\x01\x00\xB4\xF4\x92\x01\x07\x41\x00\x00\x00\x80\x81\x61\xF5\xF7\xFE\x19\x00\x69\x00\x00\xD8\x3F\x81\x79\x80\x00\x09\x5A\x5A\x00\x29\x19\x3B\x23\x00\x00\x00\x00\x20\x00\x04\x2A\x5B\x80\x00\x00\xCE\x00\x00\x00\x00\x80\x00\x08\x00\x01\x01\x00\x20\x06\x00\x00\xE4\x98\x52' > /dev/rfcomm0
Ref: How do I connect and send data to a bluetooth serial port on Linux? 
 
 
find $directory -type f -name '*' -exec mv {} $directory2/. \; 
ls / | xargs du -hs 

2010-08-02

Linux/MySQL/PHP/Chrome

Chrome

sudo apt-get remove google-chrome-stable
sudo dpkg -i google-chrome-stable_current_amd64.deb
relaunch chrome from chrome menu Help/About/Version->relaunch

MySQL
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;

You must reset your password using ALTER USER statement before executing this statement

SET PASSWORD=PASSWORD('asdfqwer'); 

# grep skip-grant-tables /lib/systemd/system/mysqld.service
#--skip-grant-tables


#################################

PHP 5.3.2
./configure --with-apxs2=/usr/sbin/apxs --with-mysqli=mysqlnd --with-mysql=/usr/local/mysql --with-gd --with-jpeg-dir --enable-soap

php-5.2.14]# ./configure --with-apxs2=/usr/sbin/apxs --enable-embedded-mysqli=shared --with-mysql=/usr/local/mysql3306 --with-gd --with-jpeg-dir --enable-soap


htaccess:

#two domains served from one root..
RewriteCond %{HTTP_HOST} domain-one.com
RewriteCond %{REQUEST_URI} !^/one
RewriteRule ^(.*)$ one/$1 [L]

RewriteCond %{HTTP_HOST} domain-two.com
RewriteCond %{REQUEST_URI} !^two
RewriteRule ^(.*)$ two/$1 [L]

***

RewriteCond %{HTTP_HOST} ^domain\.?com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain\.?com [NC]
RewriteCond %{REQUEST_URI} !/folder/
RewriteRule ^(.*)$ folder/$1 [L]

***

RewriteEngine On
RewriteBase /

# pointing for the domain abc.com to folder abc
ReWriteCond %{HTTP_HOST} abc.com
ReWriteCond %{REQUEST_URI} !abc/
ReWriteRule ^(.*)$ abc/$1 [L]

# pointing for the domain 123.com to folder 123
ReWriteCond %{HTTP_HOST} 123.com
ReWriteCond %{REQUEST_URI} !123/
ReWriteRule ^(.*)$ 123/$1 [L]

***

RewriteEngine On
RewriteBase /

# ---------------------------------------
# BEGIN Domain to folder mapping

# pointing domain_1.com to folder_1
ReWriteCond %{HTTP_HOST} domain_1.com
ReWriteCond %{REQUEST_URI} !folder_1/
ReWriteRule ^(.*)$ folder_1/$1 [L]

# pointing domain_2.com to folder_2
ReWriteCond %{HTTP_HOST} domain_2.com
ReWriteCond %{REQUEST_URI} !folder_2/
ReWriteRule ^(.*)$ folder_2/$1 [L]


Shell:
grep "RobinBobin" * | cut -d: -f1 | xargs -i -t cp ./{} ./RobinBobin/{}


.htaccess
php_value display_errors 1
php_value error_reporting E_ALL

ini_set('display_errors', 1);
error_reporting(E_ALL);