sed -i.bak '/^\s*#/d;/^$/d' nginx.conf
Author Archives: Paede
mount Google Drive
Gdrive Google Drive for Server
https://github.com/prasmussen/gdrive
wget https://docs.google.com/uc?id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA&export=download
mv ~/gdrive-linux-x64 /usr/local/bin/gdrive
sudo gdrive sync download 0BwXW7k3qPrjMZ0RmSkM1a1drdWs abacus
gdrive --service-account barren-gdrive-00b92415b917.json sync upload
--keep-local REGION_INDONESIA 0B8hjlwIdsfaBZ0pLcXdNbUVZc0k
notes for lpic 201
iscsiadm -m node -T iqn.2006-01.com.openfiler:scsi.linux3-data-1 -p 192.168.2.195 --login
iscsiadm -m discovery -t sendtargets -p openfiler1-san
repair and add raid
sudo mdadm --detail /dev/md0
cat /proc/mdstat
lsblk
mdadm --manage --re-add /dev/md0 /dev/sdc1
fdisk /dev/sdv1
Hex code:fd
mdadm --dreate /dev/md1 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdd1
pvcreate /dev/md1
pvscan
vgextend gruppe /dev/md1
lvextend -L 200G /dev/gruppe/data
lvdisplay
resize2fs /dev/gruppe/data
df -h
old people use subersion
svn commit -m “change config file”
apm install svn
apt-get install subversion
apt-get install libapache2-svn
svn checkout https://southpole.svn.beanstalkapp.com/pmt/
svn update
# Now copy your project files to a directory called pmt
svn add *
svn commit -m "Added my files"
The typical work cycle looks like this:
- Update your working copy.
- svn update
- Make changes.
- svn add
- svn delete
- svn copy
- svn move
- Examine your changes.
- svn status
- svn diff
- Possibly undo some changes.
- svn revert
- Resolve conflicts (merge others’ changes).
- svn update
- svn resolve
- Commit your changes.
- svn commit
user managment windows 10
- Press Windows key + R
- Type control userpasswords2 and click OK
- Click on add under users tab
- Click the option, “Sign-in without a Microsoft account
ifconfig vs ip
The command /bin/ip has been around for some time now. But people continue using the older command /sbin/ifconfig. Let’s be clear: ifconfig will not go away any time soon, but its newer version, ip, is more powerful and will eventually replace it.
The man page of ip may look intimidating at first, but once you get familiar with the command syntax, it is an easy read. This page will not introduce the new features of ip. It rather compares the ifconfig and ip commands to get a quick understanding of the command syntax.
Show network devices and configuration
ifconfig
ip addr show ip link show
Enable a network interface
ifconfig eth0 up
ip link set eth0 up
A network interface is disabled in a similar way:
ifconfig eth0 down
ip link set eth0 down
Set IP address
ifconfig eth0 192.168.0.77
ip address add 192.168.0.77 dev eth0
This was the simple version of the command. Often, also the network mask or the broadcast address need to be specified. The following examples show the ifconfig and ip variants.
Needless to say that the netmask can also be given in CIDR notation, e.g. as 192.168.0.77/24.
ifconfig eth0 192.168.0.77 netmask 255.255.255.0 broadcast 192.168.0.255
ip addr add 192.168.0.77/24 broadcast 192.168.0.255 dev eth0
Delete an IP address
With ip it is also possible to delete an address:
ip addr del 192.168.0.77/24 dev eth0
Add alias interface
ifconfig eth0:1 10.0.0.1/8
ip addr add 10.0.0.1/8 dev eth0 label eth0:1
ARP protocol
Add an entry in your ARP table.
arp -i eth0 -s 192.168.0.1 00:11:22:33:44:55
ip neigh add 192.168.0.1 lladdr 00:11:22:33:44:55 nud permanent dev eth0
Switch ARP resolution off on one device
ifconfig -arp eth0
ip link set dev eth0 arp off
Show the routing table
route
ip route show
A nice feature of the ip route is that one can query which interface (and gateway) a packet to a given IP address would be routed to.
ip route get 192.168.88.77
Changing the routing table
The commands to add a route on an interface are very similar:
route add -net 192.168.3.0/24 dev eth3
ip route add 192.168.3.0/24 dev eth3
The same applies to removing entries from a routing table:
route del -net 192.168.3.0/24 dev eth3
ip route del 192.168.3.0/24 dev eth3
For completeness, the command to add a gateway:
route add -net 192.168.4.0/24 gw 192.168.4.1
ip route add 192.168.4.0/24 via 192.168.4.1
This can also be combined with a dev eth3 interface.
7. How do I Add Static Route
Why you need to add Static routes or Manual routes, because that the traffic must not pass through the default gateway. We need to add Static routes to pass traffic from best way to reach the destination.
# ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0
$ sudo ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0
8. How to Remove Static Route
To remove assigned static route, simply type the following command.
# ip route del 10.10.20.0/24
$ sudo ip route del 10.10.20.0/24
9. How do I Add Persistence Static Routes
All the above route will be lost after a system restart. To add permanent Static route, edit file /etc/sysconfig/network-scripts/route-eth0 (We are storing static route for (eth0) and add the following lines and save and exist. By default route-eth0 file will not be there, need to be created.
For RHEL/CentOS/Fedora
# vi /etc/sysconfig/network-scripts/route-eth0 10.10.20.0/24 via 192.168.50.100 dev eth0
For Ubuntu/Debian/Linux Mint
Open the file /etc/network/interfaces and at the end add the persistence Static routes. IP Addresses may differ in your environment.
$ sudo vi /etc/network/interfaces
auto eth0 iface eth0 inet static address 192.168.50.2 netmask 255.255.255.0 gateway 192.168.50.100 #########{Static Route}########### up ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0
Next, restart network services after entering all the details using the following command.
# /etc/init.d/network restart
$ sudo /etc/init.d/network restart
10. How do I Add Default Gateway
Default gateway can be specified globally or for in interface-specific config file. Advantage of default gateway is If we have more than one NIC is present in the system. You can add default gateway on the fly as shown below command.
# ip route add default via 192.168.50.100
$ sudo ip route add default via 192.168.50.100
Windows 10 can not get IP Address
Open the command prompt as Administrator. Search ‘cmd’ and right click on cmd then select ‘Run as administrator’ .
Type following commands –
netsh winsock reset catalog (Reset WINSOCK entries to installation defaults)
netsh int ipv4 reset reset.log (Reset IPv4 TCP/IP stack to installation defaults)
I think Microsoft hates me!
Tell this somebody trough the phone!
Microsoft räumt das Problem seit dem 8.12.2016 ein und hat auch eine Umgehung des Problems parat, aber die Ursache scheint weiterhin unklar. Am 9.12. hatte Microsoft zwar ein Cumulative Update for Windows 10 Version 1607 und Windows Server 2016 veröffentlicht, doch dort ist weder von der Problemstellung noch von der Lösung zu lesen. Eine direkte Abhilfe wäre damit natürlich ohnehin nicht möglich, weil betroffene Computer gar nicht erst ins Internet kommen, um etwaige Bugfixes zu beziehen.
Mehrere Umgehungen des Problems
Es gibt jedoch etliche Methoden, das Problem zumindest zu umgehen. Die schnellste und einfachste: Den Windows-10-Rechner bei gedrückter Shift-Taste neu starten (alternativ in der Windows-Eingabeaufforderung shutdown /r /f /t 0
eingeben). Ohne Neustart geht es, wenn man die IP-Konfiguration als Administrator in der Kommandozeile zurücksetzt:
ipconfig /release
ipconfig /renew
oder auch schnellstart option abschalten
update countries sugar crm
update countries sugarcrm
#!/bin/bash
mysql -u Username -pPassword << EOF
use sugarcrm_db;
UPDATE contacts SET primary_address_country=’Switzerland’ WHERE primary_address_city IN (‘Zurich’,’Bern’,’Basel’);
UPDATE contacts SET primary_address_country=’Switzerland’ WHERE primary_address_country IN (‘Schweiz’,’CH’);
UPDATE contacts SET primary_address_country=’Germany’ WHERE primary_address_city IN (‘Berlin’,’Munich’,’Cologne’,’Hamburg’,’Duesseldorf’);
UPDATE contacts SET primary_address_country=’Germany’ WHERE primary_address_country IN (‘Deutschland’);
UPDATE contacts SET primary_address_country=’United Kingdom’ WHERE primary_address_city IN (‘London’,’Reading’,’Manchester’);
UPDATE contacts SET primary_address_country=’United Kingdom’ WHERE primary_address_country IN (‘England’,’Schottland’,’Scotland’,’UK’,’UnitedKingdom’);
UPDATE contacts SET primary_address_country=’United States’ WHERE primary_address_city IN (‘New York’,’San Francisco’,’Washington’,’Boston’,’NY’,’NYDC’);
UPDATE contacts SET primary_address_country=’United States’ WHERE primary_address_country IN (‘USA’,’US’,’United States of America’,’UnitedStates’);
UPDATE contacts SET primary_address_country=’United Arab Emirates’ WHERE primary_address_city IN (‘Abu Dhabi’,’Dubai’);
UPDATE contacts SET primary_address_country=’United Arab Emirates’ WHERE primary_address_country IN (‘United Arab Emirates’,’UAE’,’Arab Emirates’);
UPDATE contacts SET primary_address_country=’Sweden’ WHERE primary_address_city IN (‘Stockholm’,’Gothenburg’,’Malmo’);
UPDATE contacts SET primary_address_country=’Sweden’ WHERE primary_address_country IN (‘Schweden’,’Sverige’);
UPDATE contacts SET primary_address_country=’Norway’ WHERE primary_address_city IN (‘Oslo’);
UPDATE contacts SET primary_address_country=’Norway’ WHERE primary_address_country IN (‘Norwegen’,’Noruega’,’Norge’,’Noreg’);
UPDATE contacts SET primary_address_country=’Austria’ WHERE primary_address_city IN (‘Vienna’,’Wien’);
UPDATE contacts SET primary_address_country=’Austria’ WHERE primary_address_country IN (‘Osterreich’,’Oesterreich’);
UPDATE contacts SET primary_address_country=’Italy’ WHERE primary_address_city IN (‘Roma’,’Rome’,’Milan’,’Milano’);
UPDATE contacts SET primary_address_country=’Italy’ WHERE primary_address_country IN (‘Italia’);
UPDATE contacts SET primary_address_country=’Spain’ WHERE primary_address_city IN (‘Madrid’,’Barcelona’);
UPDATE contacts SET primary_address_country=’Spain’ WHERE primary_address_country IN (‘Espania’);
UPDATE contacts SET primary_address_country=’Denmark’ WHERE primary_address_city IN (‘Copenhagen’);
UPDATE contacts SET primary_address_country=’Denmark’ WHERE primary_address_country IN (‘Danmark’);
UPDATE contacts SET primary_address_country=’Australia’ WHERE primary_address_city IN (‘Melboourne’,’Sydney’,’Perth’);
UPDATE contacts SET primary_address_country=’Hong Kong’ WHERE primary_address_country IN (‘HongKong’,’HK’,’Hongkong’);
UPDATE contacts SET primary_address_country=’India’ WHERE primary_address_city IN (‘New Delhi’,’Kolkata’,’Mumbay’);
UPDATE contacts SET primary_address_country=’Netherlands’ WHERE primary_address_country IN (‘The Netherlands’,’Holland’,’Niederlande’,’Netherland’);
UPDATE accounts SET billing_address_country=’Switzerland’ WHERE billing_address_city IN (‘Zurich’,’Bern’,’Basel’);
UPDATE accounts SET billing_address_country=’Switzerland’ WHERE billing_address_country IN (‘Schweiz’,’CH’);
UPDATE accounts SET billing_address_country=’Germany’ WHERE billing_address_city IN (‘Berlin’,’Munich’,’Cologne’,’Hamburg’,’Duesseldorf’);
UPDATE accounts SET billing_address_country=’Germany’ WHERE billing_address_country IN (‘Deutschland’);
UPDATE accounts SET billing_address_country=’United Kingdom’ WHERE billing_address_city IN (‘London’,’Reading’,’Manchester’);
UPDATE accounts SET billing_address_country=’United Kingdom’ WHERE billing_address_country IN (‘England’,’Schottland’,’Scotland’,’UK’,’UnitedKingdom’);
UPDATE accounts SET billing_address_country=’United States’ WHERE billing_address_city IN (‘New York’,’San Francisco’,’Washington’,’Boston’,’NY’,’NYDC’);
UPDATE accounts SET billing_address_country=’United States’ WHERE billing_address_country IN (‘USA’,’US’,’United States of America’,’UnitedStates’);
UPDATE accounts SET billing_address_country=’United Arab Emirates’ WHERE billing_address_city IN (‘Abu Dhabi’,’Dubai’);
UPDATE accounts SET billing_address_country=’United Arab Emirates’ WHERE billing_address_country IN (‘United Arab Emirates’,’UAE’,’Arab Emirates’);
UPDATE accounts SET billing_address_country=’Sweden’ WHERE billing_address_city IN (‘Stockholm’,’Gothenburg’,’Malmo’);
UPDATE accounts SET billing_address_country=’Sweden’ WHERE billing_address_country IN (‘Schweden’,’Sverige’);
UPDATE accounts SET billing_address_country=’Norway’ WHERE billing_address_city IN (‘Oslo’);
UPDATE accounts SET billing_address_country=’Norway’ WHERE billing_address_country IN (‘Norwegen’,’Noruega’,’Norge’,’Noreg’);
UPDATE accounts SET billing_address_country=’Austria’ WHERE billing_address_city IN (‘Vienna’,’Wien’);
UPDATE accounts SET billing_address_country=’Austria’ WHERE billing_address_country IN (‘Osterreich’,’Oesterreich’);
UPDATE accounts SET billing_address_country=’Italy’ WHERE billing_address_city IN (‘Roma’,’Rome’,’Milan’,’Milano’);
UPDATE accounts SET billing_address_country=’Italy’ WHERE billing_address_country IN (‘Italia’);
UPDATE accounts SET billing_address_country=’Spain’ WHERE billing_address_city IN (‘Madrid’,’Barcelona’);
UPDATE accounts SET billing_address_country=’Spain’ WHERE billing_address_country IN (‘Espania’);
UPDATE accounts SET billing_address_country=’Denmark’ WHERE billing_address_city IN (‘Copenhagen’);
UPDATE accounts SET billing_address_country=’Denmark’ WHERE billing_address_country IN (‘Danmark’);
UPDATE accounts SET billing_address_country=’Australia’ WHERE billing_address_city IN (‘Melboourne’,’Sydney’,’Perth’);
UPDATE accounts SET billing_address_country=’Hong Kong’ WHERE billing_address_country IN (‘HongKong’,’HK’,’Hongkong’);
UPDATE accounts SET billing_address_country=’India’ WHERE billing_address_city IN (‘New Delhi’,’Kolkata’,’Mumbay’);
UPDATE accounts SET billing_address_country=’Netherlands’ WHERE billing_address_country IN (‘The Netherlands’,’Holland’,’Niederlande’,’Netherland’);
EOF