Dosya içerisinde geçen tüm todo ları bulun
find . -name '*.java' -exec grep -i -H -n "todo" {} \;
find . -name '*.java' -exec grep -i -H -n "todo" {} \;
alias memrss='while read command percent rss; do if [[ "${command}" != "COMMAND" ]]; then rss="$(bc <<< "scale=2;${rss}/1024")"; fi; printf "%-26s%-8s%s\n" "${command}" "${percent}" "${rss}"; done < <(ps -A --sort -rss -o comm,pmem,rss | head -n 11)'
#!/bin/bashfor i in 192.168.0.{1..10}do ping -c 1 -t 1 "$i" >/dev/null 2>&1 && echo "Ping Status of $i : Success" || echo "Ping Status of $i : Failed"done
dosyadan okuyarakwhile read hostnamedoping -c 1 -t 1 "$hostname" > /dev/null 2>&1 && echo "Ping Status of $hostname : Success" || echo "Ping Status of $hostname : Failed" done < host.txt
/usr/sbin/rabbitmqctl stop_app /usr/sbin/rabbitmqctl reset /usr/sbin/rabbitmqctl cluster rabbit@node1
# service iptables restart Redirecting to /bin/systemctl start iptables.service Failed to issue method call: Unit iptables.service failed to load: No such file or directory.
# yum install iptables-services
[dvd]
#mediaid=xxxxxxxxxx.xxxxxx
name=DVD for RHEL6
baseurl=file:///media/dvd/Server
enabled=1
gpgcheck=0
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
make install
cd utils
sh install_server.sh
[root@centos]# yum update
Install tools needed for DB [root@centos]# yum install git wget[root@centos]# yum groupinstall "Development tools"
Then finish PostgreSQL installation[root@centos]# rpm -Uvh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
[root@centos]# yum install postgresql93-server postgresql93-contrib postgresql93-devel
[root@centos]# service postgresql-9.3 initdb
[root@centos]# chkconfig postgresql-9.3 on
$ echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.3 postgresql-contrib-9.3
The following packages have ummet dependencies:
postgresql-9.3 : Depends: postgresql-client-9.3 but is not going to be installed
Depends: postgresql-common (>=1.4.2)...
...
$ sudo apt-get install postgresql-common=151.pgdg12.4+1
$ sudo apt-get install postgresql-9.3 postgresql-contrib-9.3
sudo apt-cache policy postgresql-common
find . -size -1b -exec rm -rf {} \;
find . -daystart -type f -mtime 1 -exec rm -f {} \;
SELECT datname,procpid,current_query FROM pg_stat_activity;
SELECT pg_cancel_backend(pid of the postgres process);
class RoomInline(admin.TabularInline):
model = Room
def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
field = super(RoomInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
if db_field.name == 'inside_room':
if request._obj_ is not None:
field.queryset = field.queryset.filter(building__exact = request._obj_)
else:
field.queryset = field.queryset.none()
return field
class BuildingAdmin(admin.ModelAdmin):
inlines = (RoomInline,)
def get_form(self, request, obj=None, **kwargs):
# just save obj reference for future processing in Inline
request._obj_ = obj
return super(BuildingAdmin, self).get_form(request, obj, **kwargs)
redis-cli keys "error-*" |awk '{print "redis-cli RENAME " $1 " " substr($0,7)}'|sh
1. LB1 Server: 192.168.10.111 ( eth1 )Install Keepalived
2. LB2 Server: 192.168.10.112 ( eth1 )
3. Virtual IP: 192.168.10.121
# yum install keepalivedKeepalived configuration File: /etc/keepalived/keepalived.conf
vrrp_instance VI_1 {
interface eth1 state MASTER
virtual_router_id 10
priority 101 # 101 on master, 100 on backup
virtual_ipaddress {
192.168.10.121
}
}
vrrp_instance VI_1 {
interface eth1 state BACKUP
virtual_router_id 10
priority 100 # 101 on master, 100 on backup
virtual_ipaddress {
192.168.10.121
}
}
# service keepalived start
# chkconfig keepalived on
sudo apt-get install postgresql"
sudo -u postgres psql postgresMaster tarafında ki ayarlamalar
\password postgres
/etc/postgresql/9.1/main/postgresql.conf
listen_address = '*'
wal_level = hot_standby
max_wal_senders = 3
etc/postgresql/9.1/main/pg_hba.conf
host all all 192.168.2.5/32 md5
host replication all 192.168.2.102/32 trust
select pg_start_backup('backup');
rsync -av 192.168.2.101:/var/lib/postgresql/9.1/main/ /var/lib/postgresql/9.1/main/
rm -rf /var/lib/postgresql/9.1/main/postmaster.pid
show data_directory;Son olarak master sunucudaki backup işlemini durdurmalısınız. Bunun için pgadmin de aşağıdakı sorguyu çalıştırın.
select pg_stop_backup();Slave sunucu tarafında yapılan değişklikler
standby_mode='on'eğer salave sunucuda sorgu çalıştırmak istiyorsanız slave sunucuda aşağıdaki ayarı da yapın
primary_conninfo='host=192.168.2.101'
hot_standby = on
$ sudo apt-get install x11vnc vnc-java
$ x11vnc -storepasswdçalıştıralım
Enter VNC password:
Verify password:
Write password to /home/kullanici/.vnc/passwd? [y]/n y
$ x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800
http://sistem_makine_adresi:5800