博文

在shell命令行下让mplayer循环播放和播放列表

第一步:将所有要播放的多媒体文件放在~/music/目录下;       第二步:进入music目录,执行ls > music.lst,则在music目录下生成一个名为music.lst的列表文件,并把music目录下的文件名写入到music.lst文件中;       第三步:运行mplayer -playlist music.lst即可实现列表播放       值得注意的是第二步中,生成的多媒体列表文件music.lst一定要与要播放的多媒体文件保存在同一个目录中,否则mplayer播放时会有找不到文件的错误提示。       如果要删除一些不想听的多媒体文件,则用编辑器打开music.lst列表文件,删除对应的文件名即可,保存时要注意一行一个文件名,不能有空行。       如果要增加文件,执行命令echo filename >> music.lst即可,即可将新增的文件名追加在music.lst列表文件末。

兄弟(brother)MFC7340打印机清零方法

兄弟BROTHER MFC7340打印机清零方法 硒鼓是鼓粉分离的,官方给出的硒鼓使用寿命12000张,但一般可以打印到25000张左右,到25000时机器可能会提示硒鼓错误,让你按使用说明书上的什么什么东东操作… 以下两种清零方法可以解决机器:硒鼓将用尽、硒鼓寿命为0%、硒鼓错误、计数器清零等问题。 1、粉盒清零(一般加粉时都可以操作) 步骤: 1、打开机器前盖取出硒鼓 2、取下粉盒边盖上的三个螺丝(注意别把里面的齿轮搞掉了) 3、将盖板上面的白色(或黑色的)拨片拨上去就行(逆时针转到另一头) 4、装回硒鼓放入机器就OK了 2、机器清零(提示硒鼓错误时可以按此操作) 步骤: 1、关闭电源 2、按住菜单键,打开电源,待机器面板上的3灯全亮 3、按74,出来一串数字,用笔记下,按退出 4、按90,按28,按64 5、关闭电源 6、重复步骤 2 7、按74,输入你刚才记下的数字,确认,按96 8、OK!再看看你是硒鼓寿命,变成100%了,页码计数器也变为0了!

Blocking abusive IP addresses using IPTABLES Firewall in Debian

In one of our previous article we have posted an instructional guide on how to secure your Debian/Ubuntu based VPS using IPTABLES/Netfilter. In the following article we are adding a blacklist to the firewall script which will allow you to block any abusive IP addresses or ranges of IPs in your Debian or Ubuntu based virtual server. What is iptables? It is is a user space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores. Before proceeding any further, make sure you read the article on how to secure/design the firewall in your linux vps. This includes: Flushing the old firewall rules Determining service ports Setting-up default policies Setting-up your firewall rules Saving your firewall rules BLOCKING IPs USING IPTABLES To block some abusive IP address or range of IPs, you can use the following iptables rules: ## iptables -I INPUT -s 1.2.3.4...

How to mount Google Drive on debian

图片
apt-get install ocaml camlp4-extra git clone https://github.com/OCamlPro/opam.git cd opam ./configure make sudo make install apt-get install m4 libcurl4-gnutls-dev libfuse-dev libsqlite3-dev opam init //**if error( opam init https://opam.ocaml.org/1.1 ) opam update opam install google-drive-ocamlfuse 安装成功后,进入Google Project建立一个Project https://console.developers.google.com/project 进入项目的API设置开启Drive API 建立一个OAuth验证ID 建立项目的Client ID 记录下这两个生成的参数做稍后使用 进入/root/.opam/system/bin/目录绑定项目 cd /root/.opam/system/bin/ ./google-drive-ocamlfuse -headless -label googledrive -id ##Client ID##.apps.googleusercontent.com -secret ##secret key## 执行完上述指令会返回一个https的网址在浏览器粘贴到浏览器后会进入google页面询问是否允许访问该项目,选accept然后记录下浏览器页面返回的密码,粘贴进去回车即可。 进入~/.gdfuse/googledrive cd ~/.gdfuse/googledrive nano config 编辑config修改内容例如 verification_code= [key returned from browser] client_id= [eg. 123123231.apps.googleusercontent.com] client_secret= [eg. ASDQWEWGSD!$@#@#ASD] 完成配置加载Google Drive远端存储到本地/googledrive mkdir /googledrive cd ~/.o...

Create Fake Swap in OpenVZ VPS if you get swapon failed: Operation not permitted Error

if you get swapon failed: Operation not permitted Error even if you run as root it is because in your VPS swap creation is not allowed follow below steps to Create Fake Swap in OpenVZ VPS [root@server] free -m total used free Mem: 4096 104 3991 -/+ buffers/cache: 104 3991 Swap: 0 0 0 create shell script file add lines like below [root@server] vi fakeswap.sh #!/bin/bash SWAP=”${1:-512}” NEW=”$[SWAP*1024]”; TEMP=”${NEW//?/ }”; OLD=”${TEMP:1}0″ umount /proc/meminfo 2> /dev/null sed “/^Swap\(Total\|Free\):/s,$OLD,$NEW,” /proc/meminfo > /etc/fake_meminfo mount –bind /etc/fake_meminfo /proc/meminfo free -m [root@server] chmod +x fakeswap.sh [root@server] sh fakeswap.sh [root@server] free -m total used free Mem: 4096 104 3991 -/+ buffers/cache: 104 3991 Swap: 512 0 51...

debian install shorewall

apt-get install shorewall cp /usr/share/doc/shorewall/examples/one-interface/interfaces /etc/shorewall/interfaces cp /usr/share/doc/shorewall/examples/one-interface/policy /etc/shorewall/policy cp /usr/share/doc/shorewall/examples/one-interface/rules /etc/shorewall/rules cp /usr/share/doc/shorewall/examples/one-interface/zones /etc/shorewall/zones Now open /etc/shorewall/policy file and change the line: net all DROP info removing info directive given it fills the system logs: net all DROP Now open /etc/shorewall/rules and add the following rules at the bottom of the file: HTTP/ACCEPT net $FW SSH/ACCEPT net $FW FTP/ACCEPT net $FW # real apache since varnish listens on port 80 #ACCEPT net $FW tcp 8080 ACCEPT net:192.168.1.10 $FW TCP 22 vi /etc/shorewall/shorewall.conf STARTUP_ENABLED=No —— STARTUP_ENABLED=Yes vi /etc/default/shorewall ...

Debian remove exim4

apt-get –purge remove exim4 apt-get –purge remove exim4-base dpkg -l | grep exim dpkg -P exim_name

实战Exim4配置

经过多方查阅资料,终于将exim4的配置搞定了,结果才发现,原来是这么简单。下面我就把我配置的过程写出来,与大家分享。 1)在命令行输入dpkg-reconfigure exim4-config来进行配置。 2)将配置文档分拆成小文件吗?(否) 3)邮件系统配置的常见模式:(互联网站;直接通过 SMTP 发送或接收信件) 4)系统邮件名称:(我的机器名默认的) 5)要监听的入站 SMTP 连接的 IP 地址:(空白,就是什么都不写) 6)其它可接受的邮件目的地址:( localhost.localdomain:debian:localhost) 注:我的主机名是debian 7)中转(relay)邮件的域名: (空白) 8)为这些主机进行邮件转发:(空白) 9)保持最小 DNS 查询量吗(按需拔号 Dial-on-Demand)? (否) 测试发邮件 echo “text” | mail -s “title” xxxxxxx@qq.com

web server setup with Debian 7 (Wheezy)

Setup bash and update the system cp /etc/skel/.bashrc /root/.bashrc apt-get update apt-get dist-upgrade Configure hostname correctly Make sure to have the following two lines (with the same format) at the top of your /etc/hosts file 127.0.0.1 localhost.localdomain localhost xxx.xxx.xxx.xxx web1.myserver.com web1 Note: xxx.xxx.xxx.xxx is the public IP address assigned to your server. Install all needed packages apt-get install php5 mysql-server mysql-client apache2 iptables phpmyadmin varnish shorewall vsftpd php5-cli php5-curl php5-dev php5-gd php5-idn php5-imagick php5-imap php5-memcache php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xcache php5-xmlrpc php-apc php-pear php-xml-rpc postfix apg ca-certificates heirloom-mailx MySQL/PhpMyAdmin: mysql root password: xxx repeat mysql root password: xxx web server to reconfigure automatically: apache2 configure database for phpmyadmin with dbconfig-common? Yes Password of the database’s ...