Django Cappuccino->mockingbird
grep -P "t"
sed -i "s/qwe/asd/g" `grep -rl "qwe"`
curl -X POST -d '4142430A02000' http://user:pass@myhost/hudson/job/_jobName_/postBuildResult
curl -X POST -d @myfilename http://user:pass@myhost/hudson/job/_jobName_/postBuildResult
iptables -t nat -I POSTROUTING -o br0 -s 192.168.0.188/24 -d 192.168.0.188/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source 70.8.7.6
iptables -t nat -A POSTROUTING -o eth0 -s 172.16.1.0/24 -j MASQUERADE
git push origin :yourbranch
删除_/etc/ipa/ca.crt_证书
livecd-creator --config=/usr/share/spin-kickstarts/fedora-livecd-desktop.ks \ --fslabel=Test \ --tmpdir=/root/iso/tmp \ --cache=/root/iso/cache \ --nocleanup \ --cacheonly #为节约下载时间可在以后制作时忽略
grant all privileges on *.* to root@'%' identified by '123456'; flush privileges;
cat /sys/module/kvm_intel/parameters/nested
为N则
modprobe -r kvm-intel modprobe kvm-intel nested=1
yum install fedora-release-rawhide yum-config-manager --disable fedora updates updates-testing yum-config-manager --enable rawhide yum update yum yum --releasever=rawhide distro-sync --nogpgcheck
or
dnf upgrade --refresh dnf install dnf-plugin-system-upgrade dnf system-upgrade download --refresh --releasever=rawhide --allowerasing dnf system-upgrade reboot
zypper ar --refresh http://download.opensuse.org/repositories/openSUSE:/Tumbleweed/standard/ Tumbleweed zypper ar --refresh http://download.opensuse.org/distribution/openSUSE-current/repo/oss/ 'openSUSE Current OSS' zypper ar --refresh http://download.opensuse.org/distribution/openSUSE-current/repo/non-oss/ 'openSUSE Current non-OSS' zypper ar --refresh http://download.opensuse.org/update/openSUSE-current/ 'openSUSE Current updates' zypper ar --refresh http://download.opensuse.org/update/openSUSE-non-oss-current/ 'openSUSE Current non-OSS updates' zypper dup
由于升级.net 4.5会出现vs2012部分项目失败,可以打这个补丁修复 Microsoft Visual Studio 2012 更新 (KB2781514)
针对RESTful的API可以使用这个工具 http://restclient.org
74.125.237.1
http://software.opensuse.org/download/package?project=isv:ownCloud:devel&package=owncloud-client
cp /data/app/googleplay /system/app/
curl http://www.gravatar.com/avatar/`echo -n [email protected] | md5sum` > gravatar.jpg
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
FreeRDP: checkout dbbb341; cmake .; ant release Singed keystore: keytool -genkey -alias android.keystore -keyalg RSA -validity 20000 -keystore android.keystore http://www.mail-archive.com/[email protected]/msg13763.html
echo -e "pswd4admin\n" | kinit admin echo -e "\(1\\n\)1\n\(1\\n" | ipa user-add echo -e "\)1\n\(1\\n" | ipa passwd \(1 sleep 1 echo -e "\)1\\n\)1\n$1\n" | kinit $1
server 192.168.1.11 mask 255.255.0.0 nomodify 启动ntpd后要等个几分钟,client才能去同步,否则报错说未找到合适的ntp服务器
rsync -zvrtopgal -e ssh --delete --stats --progress --exclude 'ignore.txt' [email protected]:/var/log /home/lofyer/lofyer.org/
SmartCard service: openct pcscd
很好的PDF阅读器
[demo@A ~]$ ssh-keygen -t rsa
[demo@A ~]$ cat .ssh/id_rsa.pub | ssh alpha@B 'cat >> .ssh/authorized_keys2'
[demo@A ~]$ ssh-add ~/.ssh/id_rsa or just [demo@A ~]$ ssh-copy-id alpha@B
... StrictHostKeyChecking no ...
安装文泉逸字体 apt-get install fonts-wenquanyi
deb http://mirrors.163.com/debian/ unstable main deb-src http://mirrors.163.com/debian/ unstable main
deb http://security.debian.org/ unstable/updates main deb-src http://security.debian.org/ unstable/updates main
deb http://mirrors.163.com/debian/ unstable-updates main deb-src http://mirrors.163.com/debian/ unstable-updates main deb http://apt.wxwidgets.org/ unstable-wx main deb-src http://apt.wxwidgets.org/ unstable-wx main
dns1: 199.91.73.222 dns2: 8.8.8.8
Modify /etc/audit/audit.conf to 8192 or bigger.
PHP
modify /etc/php5/conf.d/memcached.ini
/etc/yum/pluginconf.d/refresh-packagekit.conf
enabled=0
集成显卡下运行linux,将另一块硬盘或者vdisk,还有独立显卡passthrough给虚拟机Win7,协议使用spice,这是很爽啊
openssl x509 -inform DER -outform PEM -in server.crt -out server.crt.pem openssl rsa -inform DER -outform PEM -in server.key -out server.key.pem cat server.crt.pem server.key.pem >> server.pem
设置无线中继时确保主路由和从路由的SSID、密码、加密方式一致,不要使用WPA/WPA-2混合模式
大传输文件(file transfer)
server: nc -l 5555 < file_to_copy client: nc server_ip 5555 > new_file
聊天(chat)
client1: nc -l 5555 client2: nc server_ip 5555
udp connection
server: nc -4 -u -l 5555 clinet: nc -4 -u localhost 5555
[isv_ownCloud_community] name=Latest stable community release of ownCloud (CentOS_CentOS-6) type=rpm-md baseurl=http://download.opensuse.org/repositories/isv:/ownCloud:/community/CentOS_CentOS-6/ gpgcheck=1 gpgkey=http://download.opensuse.org/repositories/isv:/ownCloud:/community/CentOS_CentOS-6/repodata/repomd.xml.key enabled=1
$ ssh -ND 7070 yourname@yourserver $ gconftool-2 -R /system/proxy # show configuration $ gconftool-2 -s /system/proxy/socks_host -t int 127.0.0.1 $ gconftool-2 -s /system/proxy/socks_port -t int 7070 $ gconftool-2 -s /system/proxy/mode -t string manual # enable $ gconftool-2 -s /system/proxy/mode -t string none # disable
env x='() { :;}; echo asdasd' bash -c "echo asd"
-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=7070
DDF1 Anchor at 12345678
$ pg_resetxlog -f -x 0x9A00000 -m 0x10000 -O 0x10000 -l 0x1,0xB67,0x58 -D /var/lib/pgsql/data or $ pg_resetxlog -f /var/lib/pg_sql/data Transaction log reset
比如在vtigercrm,zabbix中
创建utf8排序的数据库即可
create database mydb DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
delete from posts where id not in (select * from (select max(n.id) from posts n group by n.title) x);
OR
create table new as select * from posts where 1 group by url; rename table new master;
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
wget -c -r -np -k -L -p http://example.com/dir0/
$ gem sources --remove https://rubygems.org/ $ gem sources -a https://ruby.taobao.org/ $ gem sources -l *** CURRENT SOURCES ***
https://ruby.taobao.org
从http://extundelete.sourceforge.net/下载源码,安装efs2progs-devel并编译。
OR
从http://www.cgsecurity.org/wiki/TestDisk下载TestDisk,解压后会发现源码以及静态编译文件,直接执行即可,其中TestDisk恢复分区,PhotoRec恢复图片文件。
Add following code to your eclipse/configuration/config.ini
[email protected]/Eclipse/configuration osgi.sharedConfiguration.area=/opt/eclipse/configuration osgi.configuration.cascaded=true
openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.cer openssl pkcs12 -in domain.pfx -nocerts -nodes -out domain.key
$ echo Hi | openssl enc -aes-128-cbc -a -salt -pass pass:wtf U2FsdGVkX18qAdhqop1SffsewHue6EOPNKv9dXc/0rI= $ echo U2FsdGVkX18qAdhqop1SffsewHue6EOPNKv9dXc/0rI= | openssl enc -aes-128-cbc -a -d -salt -pass pass:wtf Hi
OR
openssl genrsa -out key.txt 2048
echo "hello world" | openssl rsautl -inkey key.txt -encrypt >output.bin
openssl rsautl -inkey key.txt -decrypt OR
gpg --encrypt -r [email protected] >tempfile gpg --decrypt
(localpc)$ ssh -g -L 2222:localhost:22 [email protected]
(localpc)$ ssh -lroot -p 2222 localhost
(localpc)$ ssh -R -L 2222:localhost:22 [email protected]
(lofyer.org)$ ssh localhost -p 2222
(localpc)$ ssh -R 2222:localhost:22 lofyer.org
(lofyer.org)$ ssh -g -L 3333:localhost:2222 localhost
(localpc) ssh lofyer.org -p 3333
(localpc)$ ssh -CND 7777 [email protected]
- git clone https://github.com/iSECPartners/jailbreak-Windows.git
- Run mcc.msc, add Cert, save this MCC as a file(i.e. aaa).
- Run jailbreak64.exe mcc.msc aaa
- Then you can export the private key from the cert.
iptables -t nat -A PREROUTING -p tcp --dport 5060:5081 -j DNAT --to-destination 192.168.122.222:5060:5081
Change vm root password
virt-sysprep --root-password password:123456 -a os.img
sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install ap-hotspot
dd if=ioerror.file of=file bs=1M conv=noerror
qemu-kvm -m 1024 -drive file=centos58-RAW.img,index=0,if=scsi,format=raw -boot c -net nic -net user -nographic -vnc :1 -option-rom 8xx_64.rom,bootindex=1
lsi_bios 下载
rpm -e --nodpes PKG yum install PKG
ulimit -n 102400 ulimit -f 102400
autoreconf -i
pi@raspberrypi:~ $ cat .config/lxsession/LXDE-pi/autostart @lxpanel --profile LXDE-pi @pcmanfm --desktop --profile LXDE-pi @xscreensaver -no-splash x11vnc -auth /home/pi/.Xauthority -display :0 @xset s noblank @xset s off @xset -dpms
select id,title,content,url,date_format(str_to_date(date, '%d-%M-%Y'), '%Y%m%d') as date_new from posts where date_format(str_to_date(date, '%d-%M-%Y'), '%Y%m%d')=curdate()+0-1;
php -S 127.0.0.1:80 -t .
select id,title,content,url,date_format(str_to_date(date, '%d-%M-%Y'), '%Y%m%d') as date_new from posts where date_format(str_to_date(date, '%d-%M-%Y'), '%Y%m%d')=curdate()+0-1;
sudo spctl --master-disable
120 public function get_repositories() { 121 $contents = $this->get_response('users/' . $this->username . '/repos?per_page=100');
.widget-area .widget a { /*color: #757575;*/ text-decoration:none; font-size: 98%; }
perf stat -a -- sleep 10
Linux, when adding a new disc
First find your host bus number
grep mpt /sys/class/scsi_host/host?/proc_name
Which should return a line like
/sys/class/scsi_host/host0/proc_name:mptspi
where host0 is the relevant field.
use this to rescan the bus with the following command
echo "- - -" > /sys/class/scsi_host/host0/scan
In the above command the the hyphens represent controller,channel,lun, so – – – indicates all controllers, all channels and all luns should be scanned.
Edit /etc/default/grub At the end of GRUB_CMDLINE_LINUX line append "net.ifnames=0 biosdevname=0" Save the file Type "grub2-mkconfig -o /boot/grub2/grub.cfg" Type "reboot"
SELECT neutron_ml2; ALTER DATABASE neutron_ml2 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE standardattributes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Or if you're still on MySQL 5.5.2 or older which didn't support 4-byte UTF-8, use utf8 instead of utf8mb4:
ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci; ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
title: "transfer IPv6 to IPv4 via socat" date: 2018-10-09 categories: - "linux-admin"
Suppose that you have an ipv6-only server A with ip [ipv6-A], and ipv4-ipv6 server B with ip (ipv4-B, [ipv6-B]).
If you wanna visit http://[ipv6-A]:80, but your ISV does not provide some ipv6 addresses. Now then, you'll make B be your "ipv6-ipv4 relay server" with following guide.
If TCP:
root@B:~# socat tcp4-listen:2222,fork tcp6:[2001:19f0:7001:5a34:5400:01ff:feb5:5bcd]:80
If UDP:
root@B:~# socat udp4-listen:2222,fork udp6:[2001:19f0:7001:5a34:5400:01ff:feb5:5bcd]:80
Now you can visit http://ipv4-B:2222 to access http://[ipv6-A]:80