find /myfolder -name "*970.jpg" -exec mogrify -resize 256x256 {} \;
rpush user_posts:id1234 321
lrange user_posts:id1234 10 -1
ip addr add 192.168.0.12/32 dev v0002
ip addr add 192.168.0.13/32 dev v0003
ip addr add 192.168.0.14/32 dev v0004
...
ip addr add 192.168.0.XX/32 dev v00XX
iptables -t nat -A PREROUTING -i v0002 -j DNAT --to 192.168.0.1
iptables -t nat -A PREROUTING -i v0003 -j DNAT --to 192.168.0.1
iptables -t nat -A PREROUTING -i v0004 -j DNAT --to 192.168.0.1
...
iptables -t nat -A PREROUTING -i v00XX -j DNAT --to 192.168.0.1
<table class="table">
{% for category in categorys %}
{% if category.is_leaf_node %}
<tr class="treegrid-{{ forloop.counter }}">
{% set outer_counter = forloop.counter %}
<td>{{ category.name }}</td>
</tr>
{% for product in category.get_products %}
<tr class="treegrid-{{ forloop.counter|add:1 }} treegrid-parent-{{ outer_counter }}">
<td>{{ product.title }}</td>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</table>
package my.com;
import java.util.HashMap;
import java.util.Map;
public class MyJob {
class Context {
private String astring;
public Context(String string){
this.setAstring(string);
// set properties
}
public String getAstring() {
return astring;
}
public void setAstring(String astring) {
this.astring = astring;
}
}
interface Worker {
public int doWork(Context c);
}
class MultiChoose implements Worker {
@Override
public int doWork(Context c) {
c.getAstring();
System.out.println(c.getAstring() +" MultiChoose");
c.setAstring("Новая фигня");
return 0;
}
}
class Choose implements Worker {
@Override
public int doWork(Context c) {
System.out.println(c.getAstring() +" Choose");
return 0;
}
}
class AnotherString implements Worker {
@Override
public int doWork(Context c) {
System.out.println(c.getAstring() + " AnotherString");
return 0;
}
}
class Nothing implements Worker {
@Override
public int doWork(Context c) {
System.out.println("Nothing");
return 1;
}
}
public static void main(String[] args) {
MyJob job = new MyJob();
Map<String, Worker> cases = new HashMap<String, Worker>();
cases.put("Выбор", job.new Choose());
cases.put("МультиВыбор", job.new MultiChoose());
cases.put("yetanotherSubString", job.new AnotherString());
String[] keys_for_test = {"Выбор","МультиВыбор","yetanotherSubString","WrongKey"};
Context content = job.new Context("Всякая фигня");
for (String key:keys_for_test) {
Worker worker = cases.getOrDefault(key, job.new Nothing());
worker.doWork(content);
}
}
}
Всякая фигня Choose
Всякая фигня MultiChoose
Новая фигня AnotherString
Nothing
$ ps axu | grep apach