install package
download package either by browser or wget a .deb file
sudo dpkg -i XXXXX.deb
if meet issues, try below
sudo apt-get -f install
sudo dpkg -i XXXXX.deb
to update current install package
sudo apt-get update
install svn
1. install apache2
sudo apt-get install apache2
configure apache2
....
2. install svn
sudo apt-get install subversion
configure svn and start svn daemon
To list packages install in system
pkg-config --list-all
To uninstall a make install
sudo make uninstall
if not work
try
checkinstall
or use
make -n install
to trace install steps and uninstall manually
2017年8月26日 星期六
2017年8月22日 星期二
EFI switch Graphic Mode
UEFI switch between graphic/Text mode example.
EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL;
Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID**)&ConsoleControl);
if (ConsoleControl != NULL)
{
ConsoleControl->SetMode(ConsoleControl, EfiConsoleControlScreenGraphics);
}
Only below two modes can choose from.
EfiConsoleControlScreenText,
EfiConsoleControlScreenGraphics
Learn one thing. Even switch to graphic mode, you can still use EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL or even Print.
2015年3月31日 星期二
Overcome the Eight Barriers to Confidence
轉載文 建立自信心非常有用
To get a more confident You in the new year — or a more confident company, community, family, or team — first know what gets in the way. The best resolutions will go nowhere without the confidence to stick with them.
Confidence is an expectation of a positive outcome. It is not a personality trait; it is an assessment of a situation that sparks motivation. If you have confidence, you’re motivated to put in the effort, to invest the time and resources, and to persist in reaching the goal. It’s not confidence itself that produces success; it’s the investment and the effort. Without enough confidence, it’s too easy to give up prematurely or not get started at all. Hopelessness and despair prevent positive action.
To muster the confidence to work toward your goals, avoid these eight traps:
- Self-defeating assumptions.
- You think you can’t, so you don’t. A British Olympic runner is so rattled by a misstep that cost her a contest that she dropped out of the next. A company team decides that a popular world leader is so far out of their league that they don’t issue an invitation to speak at their customer event. Talented women sometimes “leave before they leave,” as Sheryl Sandberg puts it, assuming that they won’t be promoted (or succeed when they have children) so they start behaving like they’re departing years before departure, thus foreclosing their options. It’s one thing to be realistic, it’s another to behave like a loser before entering the game.
- Goals that are too big or too distant.
- I know how often leaders say they want to tackle BHAGs — “big hairy audacious goals.” But having only enormous goals can actually undermine confidence. The gap between a giant goal and today’s reality can be depressing and demotivating. Confidence comes from small wins that occur repeatedly, with each small step moving you closer to the big goal. But the small steps must be valued and turned into goals themselves. Winners think small as well as big.
- Declaring victory too soon.
- This is the dieter’s dilemma: lose the first few pounds, and feel so good that you reward yourself with chocolate cake, and when the pounds go back on, you feel so discouraged that you have more cake to feel better. I saw this pattern in a college football team that was coming off a 9-year losing streak (yes, 9 years!). After winning the first game in nearly a decade, a team member shouted that now we’ll win the championship. First, of course, they had to win the next game — which they didn’t. Step-by-step discipline builds confidence.
- Do-it-yourself-ing.
- It’s a trap to think you can go it alone, without a support system and without supporting others. Losing teams have stars, but they focus on their own records, not how well the whole team does; the resulting resentments and inequalities provoke internal battles that drag everyone down. To build your confidence, think about building the confidence of others and creating a culture in which everyone is more likely to succeed, whether through mentoring them or recognizing their strengths. Giving to others boosts happiness and self-esteem, as numerous research studies show. Supporting them makes it easier to ensure that they support you.
- Blaming someone else.
- Confidence rests on taking responsibility for one’s own behavior. Even in difficult circumstances, we have choices about how to respond to adversity. Whining about past harms reduces confidence about future possibilities. When the blame game is carried out within companies, everyone loses confidence, including external stakeholders. Confidence is the art of moving on.
- Defensiveness.
- It’s one thing to listen and respond to critics; it’s another to answer them before they’ve done anything. Don’t defend yourself if you’re not being attacked. Apologize for your mistakes, but don’t apologize for who or what you are. Instead, take pride in where you’ve come from and lead with your strengths.
- Neglecting to anticipate setbacks.
- Confidence involves a dose of reality. It is not blind optimism, thinking that everything will be fine no matter what. Confidence stems from knowing that there will be mistakes, problems, and small losses en route to big wins. After all, even winning sports teams are often behind at some point in the game. Confidence grows when you look at what can go wrong, think through alternatives, and feel you are prepared for whatever might happen.
- Over-confidence.
- Confidence is a sweet spot between despair and arrogance. Don’t let confidence slip over into the arrogant end. Over-confidence is the bane of economies (e.g., the irrational exuberance that preceded the global financial crisis), corrupt leaders (who assume they’re so necessary that they won’t get into trouble for a small expense account fudge), or individuals who swagger and feel entitled to success rather than working for it. Arrogance and complacency lead to neglect of the basics, deaf ears to critics, and blindness to the forces of change — a trap for companies as well as individuals. Sure enough, like the old proverb that “pride goeth before a fall,” the slide into a losing streak often begins with a winning streak. A little humility goes a long way to moderate arrogance and keep just the right amount of confidence.
Remember, it’s not enough just to feel confident. You have to do the work. But with an expectation of success, you can try new things, form new partnerships, contribute to shared success, and revel in small wins that move you toward bigger goals.
2012年12月16日 星期日
Objective-C 的精隨
There's three traits that differ objective-C with other object oriented language. They are sort of related but i will introduce them one by one.
Polymorphism:
Well different class sure can have same name class methods. This is not much different with other object-orient language but will cause much confuse in pure C. But this feature will be very important if combine with following two other objective-c only feature.Dynamic Typing:
This together with polymorphism will make codes more reusable since return type and parameters types no longer fixed. This can enables run-time determined object types to call same name methods which can invoke different method calls. ex.
//assume Fraction and Complex class all defined Print but show different format
id classobj;
aFraction * = [Fraction new];
aComplex *=[Complex new];
classobj = aFraction;
[classobj Print];
classobj = aComplex;
[classobj Print];
Well this is not significantly showing how Dynamic Typing's goodness. But pass attention that id object's method call is determined at runtime by which type of object it contains. This is highly not possible for other language.
Dynamic Binding
This feature means an object can determined at runtime which method it will invoke under circumstances at that time. Introduce selector concept and @selector directive. example as below
SEL action;
id graphicobject;
...
action = @selector (draw) ;
...
[graphicobject performSelector:action];
This will also introduce a series of method that under NSObject the perform support for dynamic typing and dynamic binding feature.
-(BOOL) isKindOfClass:class-object
-(BOOL) isMemberOfClass:class-object
-(BOOL) respondsToSelector:selector
-(BOOL) instancesRespondToSelector:selector
-(BOOL) isSubclassOfClass:class-object
-(id)performSelector:selector
-(id)performSelector:selector withObject:object
-(id)performSelector:selector withObject:object1 withObject:object2
2012年12月4日 星期二
Xcode 快捷鍵
轉載自http://www.cnblogs.com/yjmyzz/archive/2011/01/25/1944325.html
1. 文件
CMD + N: 新文件
CMD + SHIFT + N: 新项目
CMD + O: 打开
CMD + S: 保存
CMD + SHIFT + S: 另存为
CMD + W: 关闭窗口
CMD + SHIFT + W: 关闭文件
2. 编辑
CMD + [: 左缩进
CMD + ]: 右缩进
CMD + CTRL + LEFT: 折叠
CMD + CTRL + RIGHT: 取消折叠
CMD + CTRL + TOP: 折叠全部函数
CMD + CTRL + BOTTOM: 取消全部函数折叠
CTRL + U: 取消全部折叠
CMD + D: 添加书签
CMD + /: 注释或取消注释
CTRL + .: 参数提示
ESC: 自动提示列表
3. 调试
CMD + \: 设置或取消断点
CMD + OPT + \: 允许或禁用当前断点
CMD + OPT + B: 查看全部断点
CMD + RETURN: 编译并运行(根据设置决定是否启用断点)
CMD + R: 编译并运行(不触发断点)
CMD + Y: 编译并调试(触发断点)
CMD + SHIFT + RETURN: 终止运行或调试
CMD + B: 编译
CMD + SHIFT + K: 清理
4. 窗体
CMD + SHIFT + B: 编译窗口
CMD + SHIFT + Y: 调试代码窗口
CMD + SHIFT + R: 调试控制台
CMD + SHIFT + E: 主编辑窗口调整
5. 帮助
CMD + OPT + ?: 开发手册
CMD + CTRL + ?: 快速帮助
CMD + N: 新文件
CMD + SHIFT + N: 新项目
CMD + O: 打开
CMD + S: 保存
CMD + SHIFT + S: 另存为
CMD + W: 关闭窗口
CMD + SHIFT + W: 关闭文件
2. 编辑
CMD + [: 左缩进
CMD + ]: 右缩进
CMD + CTRL + LEFT: 折叠
CMD + CTRL + RIGHT: 取消折叠
CMD + CTRL + TOP: 折叠全部函数
CMD + CTRL + BOTTOM: 取消全部函数折叠
CTRL + U: 取消全部折叠
CMD + D: 添加书签
CMD + /: 注释或取消注释
CTRL + .: 参数提示
ESC: 自动提示列表
3. 调试
CMD + \: 设置或取消断点
CMD + OPT + \: 允许或禁用当前断点
CMD + OPT + B: 查看全部断点
CMD + RETURN: 编译并运行(根据设置决定是否启用断点)
CMD + R: 编译并运行(不触发断点)
CMD + Y: 编译并调试(触发断点)
CMD + SHIFT + RETURN: 终止运行或调试
CMD + B: 编译
CMD + SHIFT + K: 清理
4. 窗体
CMD + SHIFT + B: 编译窗口
CMD + SHIFT + Y: 调试代码窗口
CMD + SHIFT + R: 调试控制台
CMD + SHIFT + E: 主编辑窗口调整
5. 帮助
CMD + OPT + ?: 开发手册
CMD + CTRL + ?: 快速帮助
下面也是一些有用的快捷键(转自http://www.cppblog.com/brucejini/archive/2010/12/24/137367.html)
Command + Shift + E :扩展编辑器
Command + [ :左移代码块
Command + ] :右移代码块
Tab :接受代码提示
Esc :显示代码提示菜单
Ctrl + . (句点):循环浏览代码提示
Shift + Ctrl + . (句点):反向循环浏览代码提示
Ctrl + / :移动到代码提示中的下一个占位符
Command + Ctrl + S :创建快照
Ctrl + F :前移光标
Ctrl + B :后移光标
Ctrl + P :移动光标到上一行
Ctrl + N:移动光标到下一行
Ctrl + A : 移动光标到本行行首
Ctrl + E : 移动光标到本行行尾 --杨过注:这二个太有用了,刚开始用XCode,一直奇怪为啥Home与End键为啥不能直接定位到行首、行尾?
Ctrl + T :交换光标左右两边的字符
Ctrl + D:删除光标右边的字符
Ctrl + K :删除本行
Ctrl + L : 将插入点置于窗口正中
Command + Alt + D:显示open quickly 窗口
Command + Alt + 上方向键 :打开配套文件
Command + D :添加书签
Option + 双击:在文档中搜索
Command + Y :以调试方式运行程序
Command + Alt + P : 继续(在调试中)
Command + Alt + 0 :跳过
Command + Alt + I :跳入
Command + Alt + T :跳出
2012年9月21日 星期五
How to include and make use of .uni files to your EDKII/UDK applications.
Well. Today i need to build up a helper to my efi application. I check for the sample in network package. I found one way. Steps as below.
- put all your helper text into a uni file. for example: myhelp.uni
- add myhelp.uni to [Sources]. This will trigger the HII compiler to autogen related HII data structure.
- Initialize your HII handle with HiiAddPackages mHiiHandle = HiiAddPackages (&gEfiCallerIdGuid, ImageHandle, BASE_NAMEStrings, NULL); IMPORTANT! the third parameter should be your BASE_NAME in your inf file with "Strings" appended. This is due to autogen will use this fixed variable name.
- You can use ShellPrintHiiEx function to display Messages. ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_INPUT), mHiiHandle);
2012年7月12日 星期四
While Secure Boot Active run Shell Application
As you know, secure boot is one of the crucial features that MS Win8 emphasize on. To protect the entire system since the boot time. Albeit secure boot feature is not explicitly exclude tradition CSM, but current IBV implementation put secure boot under CSMless mode. This will lead to user can not boot from USB dongle into DOS to access traditional tools like IRU or flash rom. Instead, UEFI shell kick in. But there's some tricky steps to enable boot to UEFI shell when secure boot enable.
makecert -n "CN=PkRoot" -r -sv PkRoot.pvk PkRoot.cer
You can replace "PkRoot" whatever name you like. This will generate a private key and a certificate. Remember the password you type.
Also memorize Kek key password. It will be used to sign efi applications.
xxx is the password for kek private key.
xxx still be password of Kekroot.pvk
But there's one VERY critical step left.
- You need to generate a certificate. To achieve this, you need to install latest Windows Kit. Under it's install directory find an executable file named "makecert.exe" depend on your working computer's X86 or X64. execute following command.
makecert -n "CN=PkRoot" -r -sv PkRoot.pvk PkRoot.cer
You can replace "PkRoot" whatever name you like. This will generate a private key and a certificate. Remember the password you type.
- Then proceed to generate Kek key and certificate using the platform key you just generated.
Also memorize Kek key password. It will be used to sign efi applications.
- Transform kek private key to pfx format (PKCS#12)
xxx is the password for kek private key.
- Now you can use KekRoot.cer and KekRoot.pfx to sign whatever efi application or driver you want to execute on your platform. Command as below.
xxx still be password of Kekroot.pvk
But there's one VERY critical step left.
- You need to include the KekRoot.cer to your BIOS image and put it in ALLOW certificate. Different IBV should probably have different ways to include ALLOW certificate. You should check with your IBV for detail.
訂閱:
文章 (Atom)